Bug 1120

Summary: Refine HiDPI Support
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: enhancement CC: askinner, sgothel
Priority: ---    
Version: 2.3.0   
Hardware: All   
OS: all   
Type: --- SCM Refs:
1341fe0216e4f12d7243e98290cc97824b1c0b5c 6516a52d3da5cced924db63b64af911d55355325
Workaround: ---
Bug Depends on:    
Bug Blocks: 1373    

Description Sven Gothel 2015-01-23 01:18:14 CET
- Standalone NativeWindow getScale/convert method w/o window creation.
  Here a given rectangular area shall be used to query the 
  return the monitor/screen index with highest coverage 
  and its pixel-scale.

- Use fractional scale

- Figure out how to receive pixel accurate mouse coordinates 
  from mouse events on (OSX, AWT + NEWT)

- Figure out how to round a fractional scale conversion 
  and avoid distortion scaling pixel-viewport <-> window-viewport
Comment 1 Sven Gothel 2015-01-23 01:20:07 CET
(In reply to comment #0)
> - Standalone NativeWindow getScale/convert method w/o window creation.
>   Here a given rectangular area shall be used to query the 
>   return the monitor/screen index with highest coverage 
>   and its pixel-scale.
> 
> - Use fractional scale
> 
> - Figure out how to receive pixel accurate mouse coordinates 
>   from mouse events on (OSX, AWT + NEWT)
> 
> - Figure out how to round a fractional scale conversion 
>   and avoid distortion scaling pixel-viewport <-> window-viewport

- Also ensure a change of pixel-size will be propagated 
  to AWT elements.
  Note: On NEWT this feature already works.
Comment 2 Sven Gothel 2015-01-23 01:21:00 CET
1341fe0216e4f12d7243e98290cc97824b1c0b5c
  Add OSXUtil.GetPixelScale(final RectangleImmutable r, final int[] screenIndexOut)
Comment 3 Sven Gothel 2015-01-27 00:50:25 CET
commit 6516a52d3da5cced924db63b64af911d55355325:

- Use float[2] for pixel-scale.
  Utilize simple integer rounding:
    int-pixel-units = (int) ( int-window-units * pixel-scale + 0.5f )

- Provide minimum and maximum allowed pixel-scale values 
  to be set by platform, supporting generic pixel-scale validation.

- Remove 'OSXUtil.GetPixelScale(final RectangleImmutable r, final int[] screenIndexOut)',
  implementation for all platforms would cause huge redundancy of 
  Screen and MonitorDevice code (duplication of NEWT).

- instead, add 'float[2] pixelScale' to NEWT's MonitorDevice

- Detect change of pixel-scale and propagate accordingly.
  This allows GLCanvas, GLJPanel and NewtCanvasAWT instances
  to be dragged between monitor devices w/ different pixel-scale.

- OSX: Handle native triggered reshape events off-thread to avoid EDT congestion
       due to locked window when consuming deferred events on EDT.