Both commits had flaws regarding: - GL spec: Pointer functions required passed memory pointers to persist
- JNI: Primitive arrays may change their native memory location (swap), even if they were not GC'ed.
Xerxes Ranby and I discussed whether we are able to track the primitive non direct NIO backed arrays and pinpoint them. JNI's Get*ArrayElements may be able to pinpoint, however it could result in a copy of the data, which would render this feature non performant. The tracking itself may be another no-go, since it would add up complexity and failing to free resources would be another negative sideeffect.
Simplified pbuffer replacement: Simply keep holding the pbuffer reference in native code until receiving newPBuffer @ swap. The newPBuffer will be established @draw method. This allows removing interaction at destroy pbuffer, which caused garbage and crash.
Remove pbuffer swap garbage See above.
Split pbuffer/FBO revalidation/redraw
Don't sync @ needsDisplay - No need to sync @ repaint command setNSOpenGLLayerNeedsDisplay* since we use volatiles and all lifecycle action is done @draw -> faster
Add GLRendererQuirks: - Contains centralized 'tagged' workarounds for GL renderer bugs (quirks) - Accessible via GLContext and GLDrawableFactory - Initialized in GLContext.setAvailability* -
Simplify GLGraphicsConfigurationUtil.fixOffscreenGLCapabilities(..) & use Quirks - use quirks - instead of passing booleans for each config, pass factory & device
Fix shared EGL/ES resources: - GLProfile needs to initialize EGLDrawableFactory's shared resources before desktop, so EGLDrawableFactory can use the fallback defaultDisplay & defaultSharedResource for host mapped sharedResources (hack).
- If using defaultSharedResources for host mapped ones, do not go through initialization cycles - simply map (sharedResource + context).
- EGLDrawableFactory: Use device's unique-key instead of connection only, since the latter causes a collision (EGL-connection == X11-connection).
NativeWindowFactory/NEWT: Use relative sub-package names in NativeWindowFactory's TYPE_* strings, not NEWT's; NEWTFactory: Use default NEWT package name if rel. 'path'.
Use relative sub-package names in NativeWindowFactory's TYPE_* strings, not NEWT's Otherwise NEWT depends solely on NativeWindowFactory strings
- Default subpackages denominate a relative path, i.e. start with a dot: '.egl', '.windows', '.x11' - Custom name may be absolute, eg: 'my.company.special.drivers.chip4'
NEWTFactory: Use default NEWT package name if relative 'path'. - If NativeWindowFactory type starts w/ dot (rel. path), simply prepend the default NEWT package prefix otherwise use complete package name as-is.