aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:21:36 +0200
committerSven Gothel <[email protected]>2014-07-03 16:21:36 +0200
commit556d92b63555a085b25e32b1cd55afce24edd07a (patch)
tree6be2b02c62a77d5aba81ffbe34c46960608be163 /src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
parenta90f4a51dffec3247278e3c683ed4462b1dd9ab5 (diff)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java84
1 files changed, 42 insertions, 42 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
index a401944ef..fd8052b96 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
@@ -95,7 +95,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
if( null != device) {
return getOrCreateSharedResourceImpl( device );
}
- } catch (GLException gle) {
+ } catch (final GLException gle) {
if(DEBUG) {
System.err.println("Caught exception on thread "+getThreadName());
gle.printStackTrace();
@@ -112,7 +112,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
*
* @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
*/
- public final GLContext getOrCreateSharedContext(AbstractGraphicsDevice device) {
+ public final GLContext getOrCreateSharedContext(final AbstractGraphicsDevice device) {
final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
if(null!=sr) {
return sr.getContext();
@@ -121,7 +121,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- protected final boolean createSharedResourceImpl(AbstractGraphicsDevice device) {
+ protected final boolean createSharedResourceImpl(final AbstractGraphicsDevice device) {
final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
if(null!=sr) {
return sr.isValid();
@@ -130,7 +130,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- public final GLRendererQuirks getRendererQuirks(AbstractGraphicsDevice device) {
+ public final GLRendererQuirks getRendererQuirks(final AbstractGraphicsDevice device) {
final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
if(null!=sr) {
return sr.getRendererQuirks();
@@ -145,7 +145,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
*
* @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared device to be used, may be <code>null</code> for the platform's default device.
*/
- protected final AbstractGraphicsDevice getOrCreateSharedDevice(AbstractGraphicsDevice device) {
+ protected final AbstractGraphicsDevice getOrCreateSharedDevice(final AbstractGraphicsDevice device) {
final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
if(null!=sr) {
return sr.getDevice();
@@ -164,7 +164,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
// Dispatching GLDrawable construction in respect to the NativeSurface Capabilities
//
@Override
- public final GLDrawable createGLDrawable(NativeSurface target) {
+ public final GLDrawable createGLDrawable(final NativeSurface target) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
@@ -252,16 +252,16 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp);
@Override
- public final GLPbuffer createGLPbuffer(AbstractGraphicsDevice deviceReq,
- GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser,
- int width,
- int height,
- GLContext shareWith) {
+ public final GLPbuffer createGLPbuffer(final AbstractGraphicsDevice deviceReq,
+ final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser,
+ final int width,
+ final int height,
+ final GLContext shareWith) {
if(width<=0 || height<=0) {
throw new GLException("initial size must be positive (were (" + width + " x " + height + "))");
}
- AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
+ final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
if(null == device) {
throw new GLException("No shared device for requested: "+deviceReq);
}
@@ -285,8 +285,8 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
//
@Override
- public final boolean canCreateFBO(AbstractGraphicsDevice deviceReq, GLProfile glp) {
- AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
+ public final boolean canCreateFBO(final AbstractGraphicsDevice deviceReq, final GLProfile glp) {
+ final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
if(null == device) {
throw new GLException("No shared device for requested: "+deviceReq);
}
@@ -294,11 +294,11 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice deviceReq,
- GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser,
- int width, int height,
- GLContext shareWith) {
+ public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(final AbstractGraphicsDevice deviceReq,
+ final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser,
+ final int width, final int height,
+ final GLContext shareWith) {
final GLDrawable drawable = createOffscreenDrawable( deviceReq, capsRequested, chooser, width, height );
drawable.setRealized(true);
final GLContext context = drawable.createContext(shareWith);
@@ -309,10 +309,10 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice deviceReq,
- GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser,
- int width, int height) {
+ public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(final AbstractGraphicsDevice deviceReq,
+ final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser,
+ final int width, final int height) {
final GLDrawable drawable = createOffscreenDrawable( deviceReq, capsRequested, chooser, width, height );
drawable.setRealized(true);
if(drawable instanceof GLFBODrawableImpl) {
@@ -322,7 +322,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- public final GLAutoDrawable createDummyAutoDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+ public final GLAutoDrawable createDummyAutoDrawable(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser) {
final GLDrawable drawable = createDummyDrawable(deviceReq, createNewDevice, capsRequested, chooser);
drawable.setRealized(true);
final GLAutoDrawable sharedDrawable = new GLAutoDrawableDelegate(drawable, null, null, true /*ownDevice*/, null) { };
@@ -330,10 +330,10 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- public final GLDrawable createOffscreenDrawable(AbstractGraphicsDevice deviceReq,
- GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser,
- int width, int height) {
+ public final GLDrawable createOffscreenDrawable(final AbstractGraphicsDevice deviceReq,
+ final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser,
+ final int width, final int height) {
if(width<=0 || height<=0) {
throw new GLException("initial size must be positive (were (" + width + " x " + height + "))");
}
@@ -355,7 +355,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- public final GLDrawable createDummyDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+ public final GLDrawable createDummyDrawable(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser) {
final AbstractGraphicsDevice device = createNewDevice ? getOrCreateSharedDevice(deviceReq) : deviceReq;
if(null == device) {
throw new GLException("No shared device for requested: "+deviceReq+", createNewDevice "+createNewDevice);
@@ -374,7 +374,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
/** Creates a platform independent unrealized FBO offscreen GLDrawable */
- protected final GLFBODrawable createFBODrawableImpl(NativeSurface dummySurface, GLCapabilitiesImmutable fboCaps, int textureUnit) {
+ protected final GLFBODrawable createFBODrawableImpl(final NativeSurface dummySurface, final GLCapabilitiesImmutable fboCaps, final int textureUnit) {
final GLDrawableImpl dummyDrawable = createOnscreenDrawableImpl(dummySurface);
return new GLFBODrawableImpl(this, dummyDrawable, dummySurface, fboCaps, textureUnit);
}
@@ -424,8 +424,8 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
*
* @return the created {@link ProxySurface} instance w/o defined surface handle but platform specific {@link UpstreamSurfaceHook}.
*/
- public final ProxySurface createDummySurface(AbstractGraphicsDevice deviceReq, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser,
- int width, int height) {
+ public final ProxySurface createDummySurface(final AbstractGraphicsDevice deviceReq, final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser chooser,
+ final int width, final int height) {
final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
if(null == device) {
throw new GLException("No shared device for requested: "+deviceReq);
@@ -461,8 +461,8 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
//
@Override
- public ProxySurface createProxySurface(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle,
- GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
+ public ProxySurface createProxySurface(final AbstractGraphicsDevice deviceReq, final int screenIdx, final long windowHandle,
+ final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstream) {
final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
if(null == device) {
throw new GLException("No shared device for requested: "+deviceReq);
@@ -520,7 +520,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
* @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory,
* or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL.
*/
- public static GLDrawableFactoryImpl getFactoryImpl(GLProfile glp) {
+ public static GLDrawableFactoryImpl getFactoryImpl(final GLProfile glp) {
return (GLDrawableFactoryImpl) getFactory(glp);
}
@@ -579,7 +579,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
* @throws IllegalArgumentException if any of the parameters were
* out-of-bounds
*/
- public boolean setDisplayGamma(float gamma, float brightness, float contrast) throws IllegalArgumentException {
+ public boolean setDisplayGamma(final float gamma, final float brightness, final float contrast) throws IllegalArgumentException {
if ((brightness < -1.0f) || (brightness > 1.0f)) {
throw new IllegalArgumentException("Brightness must be between -1.0 and 1.0");
}
@@ -587,13 +587,13 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
throw new IllegalArgumentException("Contrast must be greater than 0.0");
}
// FIXME: ensure gamma is > 1.0? Are smaller / negative values legal?
- int rampLength = getGammaRampLength();
+ final int rampLength = getGammaRampLength();
if (rampLength == 0) {
return false;
}
- float[] gammaRamp = new float[rampLength];
+ final float[] gammaRamp = new float[rampLength];
for (int i = 0; i < rampLength; i++) {
- float intensity = (float) i / (float) (rampLength - 1);
+ final float intensity = (float) i / (float) (rampLength - 1);
// apply gamma
float rampEntry = (float) java.lang.Math.pow(intensity, gamma);
// apply brightness
@@ -631,7 +631,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
/** Sets the gamma ramp for the main screen. Returns false if gamma
ramp changes were not supported. */
- protected boolean setGammaRamp(float[] ramp) {
+ protected boolean setGammaRamp(final float[] ramp) {
return false;
}
@@ -644,7 +644,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
/** Resets the gamma ramp, potentially using the specified Buffer as
data to restore the original values. */
- protected void resetGammaRamp(Buffer originalGammaRamp) {
+ protected void resetGammaRamp(final Buffer originalGammaRamp) {
}
// Shutdown hook mechanism for resetting gamma