diff options
author | Sven Gothel <[email protected]> | 2015-08-31 08:41:07 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-08-31 08:41:07 +0200 |
commit | cf9e2f2cb8ead7efd7751dcbfaecb36ed06cf9d6 (patch) | |
tree | 5b0879c7146983221074ed9c687be2fba7db779d /src/nativewindow/classes/jogamp | |
parent | cc00d9b6c5a5c6b71ba14311fc6b17ce932d9a1e (diff) |
Bug 1210 - Use manual impl. XRenderFindVisualFormat instead of buggy generated version
- XRenderDirectFormat XVisual2XRenderMask(..):
- Move from JOGL's X11GLXGraphicsConfiguration -> Nativewindow X11GraphicsConfiguration
- Always use manual impl. of XRenderFindVisualFormat
Additionally:
- Add X11GraphicsConfiguration.XVisualInfo2X11Capabilities(..)
allowing to properly setup the resulting Capabilities instance
as used in X11GraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(..)
- XVisualInfo:
- Add 'String toString()'
- 'XVisualInfo create(XVisualInfo s)' uses source buffer size!
- XGetVisualInfo: Use returned buffer-capacity/count for element-size
and also bail out if count<=0
Diffstat (limited to 'src/nativewindow/classes/jogamp')
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java index f8a11f91e..4257376a0 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java +++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java @@ -42,6 +42,7 @@ import com.jogamp.nativewindow.NativeWindowException; import com.jogamp.nativewindow.VisualIDHolder; import com.jogamp.nativewindow.x11.X11GraphicsConfiguration; +import com.jogamp.nativewindow.x11.X11GraphicsDevice; import com.jogamp.nativewindow.x11.X11GraphicsScreen; public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactory { @@ -59,15 +60,17 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor if(!(screen instanceof X11GraphicsScreen)) { throw new NativeWindowException("Only valid X11GraphicsScreen are allowed"); } - final X11Capabilities x11CapsChosen; + final XVisualInfo x11VisualInfo; if(VisualIDHolder.VID_UNDEFINED == nativeVisualID) { - x11CapsChosen = new X11Capabilities(getXVisualInfo(screen, capsChosen)); + x11VisualInfo = getXVisualInfo(screen, capsChosen); } else { - x11CapsChosen = new X11Capabilities(getXVisualInfo(screen, nativeVisualID)); + x11VisualInfo = getXVisualInfo(screen, nativeVisualID); } + + final X11Capabilities x11CapsChosen = X11GraphicsConfiguration.XVisualInfo2X11Capabilities((X11GraphicsDevice)screen.getDevice(), x11VisualInfo); final AbstractGraphicsConfiguration res = new X11GraphicsConfiguration((X11GraphicsScreen)screen, x11CapsChosen, capsRequested, x11CapsChosen.getXVisualInfo()); if(DEBUG) { - System.err.println("X11GraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(visualID 0x"+Integer.toHexString(nativeVisualID)+", "+screen+","+capsChosen+"): "+res); + System.err.println("X11GraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(visualID 0x"+Integer.toHexString(nativeVisualID)+", "+x11VisualInfo+", "+screen+","+capsChosen+"): "+res); } return res; } @@ -85,7 +88,6 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor if(xvis==null || num[0]<1) { return null; } - return XVisualInfo.create(xvis[0]); } |