From 8be9d9b5bd71854f4da15294b47125a8a4975e31 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 13 Feb 2014 18:12:27 +0100 Subject: SurfaceUpdatedListener: Order methods in impl. Class; SurfaceUpdatedListener: Mark methods final, use volatile 'isEmpty' to bail out early @ surfaceUpdated. --- .../classes/com/jogamp/newt/opengl/GLWindow.java | 40 ++++++++++---------- src/newt/classes/jogamp/newt/WindowImpl.java | 43 ++++++++++------------ 2 files changed, 40 insertions(+), 43 deletions(-) (limited to 'src/newt/classes') diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index ca8ab6733..4b740927b 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -682,21 +682,6 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind window.runOnEDTIfAvail(wait, task); } - @Override - public final void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) { - window.removeSurfaceUpdatedListener(l); - } - - @Override - public final void addSurfaceUpdatedListener(SurfaceUpdatedListener l) { - window.addSurfaceUpdatedListener(l); - } - - @Override - public final void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException { - window.addSurfaceUpdatedListener(index, l); - } - @Override public void sendWindowEvent(int eventType) { window.sendWindowEvent(eventType); @@ -850,6 +835,26 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind return window.surfaceSwap(); } + @Override + public final void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) { + window.removeSurfaceUpdatedListener(l); + } + + @Override + public final void addSurfaceUpdatedListener(SurfaceUpdatedListener l) { + window.addSurfaceUpdatedListener(l); + } + + @Override + public final void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException { + window.addSurfaceUpdatedListener(index, l); + } + + @Override + public final void surfaceUpdated(Object updater, NativeSurface ns, long when) { + window.surfaceUpdated(updater, ns, when); + } + @Override public final long getWindowHandle() { return window.getWindowHandle(); @@ -877,11 +882,6 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind return window.getScreenIndex(); } - @Override - public final void surfaceUpdated(Object updater, NativeSurface ns, long when) { - window.surfaceUpdated(updater, ns, when); - } - /** * A most simple JOGL AWT test entry */ diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 1e2291c8f..7f7cb61a9 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -810,6 +810,26 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer return false; } + @Override + public final void addSurfaceUpdatedListener(SurfaceUpdatedListener l) { + surfaceUpdatedHelper.addSurfaceUpdatedListener(l); + } + + @Override + public final void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException { + surfaceUpdatedHelper.addSurfaceUpdatedListener(index, l); + } + + @Override + public final void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) { + surfaceUpdatedHelper.removeSurfaceUpdatedListener(l); + } + + @Override + public final void surfaceUpdated(Object updater, NativeSurface ns, long when) { + surfaceUpdatedHelper.surfaceUpdated(updater, ns, when); + } + @Override public final AbstractGraphicsConfiguration getGraphicsConfiguration() { return config.getNativeGraphicsConfiguration(); @@ -2506,29 +2526,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer return true; } - // - // SurfaceUpdatedListener Support - // - @Override - public final void addSurfaceUpdatedListener(SurfaceUpdatedListener l) { - surfaceUpdatedHelper.addSurfaceUpdatedListener(l); - } - - @Override - public final void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException { - surfaceUpdatedHelper.addSurfaceUpdatedListener(index, l); - } - - @Override - public final void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) { - surfaceUpdatedHelper.removeSurfaceUpdatedListener(l); - } - - @Override - public final void surfaceUpdated(Object updater, NativeSurface ns, long when) { - surfaceUpdatedHelper.surfaceUpdated(updater, ns, when); - } - // // MouseListener/Event Support // -- cgit v1.2.3