From e2d7816823039fc75be809d64b88a3d3af9cdca8 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 10 Oct 2014 03:37:21 +0200 Subject: Bug 1093 - NEWT PointerIcon swizzled on X11 and OSX; WindowIcon swizzled on OSX ([R] -> [B]) Following mistakes were made in native PixelFormat for PointerIcon and WindowIcon: PointerIcon: X11: RGBA8888 -> BGRA8888 OSX: BGRA8888 -> RGBA8888 WindowIcon: OSX: BGRA8888 -> RGBA8888 Test case: TestWindowAndPointerIconNEWT (requires visual validation) +++ Summary: PointerIcon: BGRA8888: X11, Win32 RGBA8888: OSX WindowIcon: BGRA8888: X11, Win32 RGBA8888: OSX +++ Reported by 'LT' --- src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java | 5 ++++- src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/newt/classes/jogamp') diff --git a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java index 4ecc2fdcf..051294dce 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java @@ -70,7 +70,7 @@ public class DisplayDriver extends DisplayImpl { // NOTE: MUST BE DIRECT BUFFER, since NSBitmapImageRep uses buffer directly! 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 */); + image = PNGPixelRect.read(urlConn.getInputStream(), PixelFormat.RGBA8888, true /* directBuffer */, 0 /* destMinStrideInBytes */, false /* destIsGLOriented */); } catch (final Exception e) { e.printStackTrace(); } @@ -96,6 +96,9 @@ public class DisplayDriver extends DisplayImpl { public DisplayDriver() { } + @Override + public PixelFormat getNativePointerIconPixelFormat() { return PixelFormat.RGBA8888; } + @Override protected void dispatchMessagesNative() { // nop diff --git a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java index 759c27450..e2b9a65d1 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java +++ b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java @@ -124,9 +124,6 @@ public class DisplayDriver extends DisplayImpl { /** Returns null if !{@link #isNativeValid()}, otherwise the Boolean value of {@link X11GraphicsDevice#isXineramaEnabled()}. */ protected Boolean isXineramaEnabled() { return isNativeValid() ? Boolean.valueOf(((X11GraphicsDevice)aDevice).isXineramaEnabled()) : null; } - @Override - public final PixelFormat getNativePointerIconPixelFormat() { return PixelFormat.RGBA8888; } - @Override 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); -- cgit v1.2.3