Jogamp
Bug 741 HiDPI: Add ScalableSurface interface to get/set pixelScale w/ full OSX impl.
authorSven Gothel <sgothel@jausoft.com>
Sun, 8 Jun 2014 06:11:57 +0000 (08:11 +0200)
committerSven Gothel <sgothel@jausoft.com>
Sun, 8 Jun 2014 06:11:57 +0000 (08:11 +0200)
commit2571ed0b5ef14155d204540d38b564a7d4cd47b6
tree8aaf1171af1b95f1cb1ebe706771a4aff3752c2f
parentff7bf3122fd2007bbe70cfadca9f0f978ee96456
Bug 741 HiDPI: Add ScalableSurface interface to get/set pixelScale w/ full OSX impl.

Add ScalableSurface interface
  - To set pixelScale before and after realization
  - To get pixelScale

  - Implemented on:
    - NEWT Window
      - Generic impl. in WindowImpl
      - OSX WindowDriver impl.
        - Also propagetes pixelScale to parent JAWTWindow if offscreen (NewtCanvasAWT)
      - AWT WindowDriver impl.

    - JAWTWindow / OSXCalayer
      - AWT GLCanvas
      - AWT GLJPanel
      - NEWTCanvasAWT:
        - Propagates NEWT Window's pixelScale to underlying JAWTWindow

    - WrappedSurface for pixelScale propagation
      using offscreen drawables, i.e. GLJPanel

    - Generic helper in SurfaceScaleUtils (nativewindow package)

  - Fully implemented on OSX

  - Capable to switch pixelScale before realization,
    i.e. native-creation, as well as on-the-fly.

  - Impl. uses int[2] for pixelScale to support
    non-uniform scale.

Test cases:
  - com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT
  - com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT
  - com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT
  - com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT

  - Press 'x' to toggle HiDPI
  - Commandline '-pixelScale <value>'
  - Added basic auto unit test (setting pre-realization)
25 files changed:
.gitignore
make/scripts/tests.sh
src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
src/jogl/native/macosx/MacOSXWindowSystemInterface-calayer.m
src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java [new file with mode: 0644]
src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java [new file with mode: 0644]
src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
src/nativewindow/native/macosx/OSXmisc.m
src/newt/classes/com/jogamp/newt/Window.java
src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
src/newt/classes/jogamp/newt/WindowImpl.java
src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
src/newt/native/MacWindow.m
src/newt/native/NewtMacWindow.m
src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java
src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java
src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java
src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java
http://JogAmp.org git info: FAQ, tutorial and man pages.