diff options
author | Harvey Harrison <[email protected]> | 2014-01-11 00:41:12 -0800 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2014-05-03 09:08:36 -0700 |
commit | c5a01013647f2df1e48e6888ca1ab42f5ba29cd4 (patch) | |
tree | ef544d163c67a080f576c60e02b990bf906f34dc | |
parent | fd5734e99be82efdefcf07b999539470c407f01a (diff) |
j3dcore: kill use of SUN_global_alpha
Due to a typo testing for the extension, the jogl pipeline has never enabled this
extension. Just kill it.
Signed-off-by: Harvey Harrison <[email protected]>
10 files changed, 4 insertions, 128 deletions
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java index bdd9f2d..ef946d7 100644 --- a/src/classes/share/javax/media/j3d/Canvas3D.java +++ b/src/classes/share/javax/media/j3d/Canvas3D.java @@ -764,7 +764,8 @@ ArrayList<Integer> textureIdResourceFreeList = new ArrayList<Integer>(); // // NOTE: we should remove EXT_BGR and EXT_ABGR when the imaging code is // rewritten - static final int SUN_GLOBAL_ALPHA = 0x1; + // killed global alpha + //static final int SUN_GLOBAL_ALPHA = 0x1; static final int EXT_ABGR = 0x2; static final int EXT_BGR = 0x4; static final int MULTISAMPLE = 0x8; @@ -4014,10 +4015,6 @@ public Point getLocationOnScreen() { } } - boolean supportGlobalAlpha() { - return ((extensionsSupported & SUN_GLOBAL_ALPHA) != 0); - } - /** * Enable separate specular color if it is not overriden by the * property j3d.disableSeparateSpecular. @@ -4721,10 +4718,6 @@ boolean isAntialiasingSet() { antialiasingSet = enable; } - void setGlobalAlpha(Context ctx, float alpha) { - Pipeline.getPipeline().setGlobalAlpha(ctx, alpha); - } - // Native method to update separate specular color control void updateSeparateSpecularColorEnable(Context ctx, boolean control) { Pipeline.getPipeline().updateSeparateSpecularColorEnable(ctx, control); diff --git a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java index eedc2e8..53a691a 100644 --- a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java +++ b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java @@ -1658,25 +1658,12 @@ ArrayList<ArrayList<MorphRetained>> morphUserLists = null; this, vertexFormat, useAlpha, ignoreVC); } - void disableGlobalAlpha(Context ctx, boolean useAlpha, boolean ignoreVC) { - // If global alpha was turned on, then disable it - Pipeline.getPipeline().disableGlobalAlpha(ctx, - this, vertexFormat, useAlpha, ignoreVC); - } - - float[] updateAlphaInFloatRefColors(Canvas3D cv, int screen, float alpha) { //System.err.println("updateAlphaInFloatRefColors screen = " + screen + // " alpha " + alpha ); - // no need to update alpha values if canvas supports global alpha - if (cv.supportGlobalAlpha()) { - cv.setGlobalAlpha(cv.ctx, alpha); - return mirrorFloatRefColors[0]; - } - - // update alpha only if vertex format includes alpha + // update alpha only if vertex format includes alpha if (((vertexFormat | c4fAllocated) & GeometryArray.WITH_ALPHA) == 0) return mirrorFloatRefColors[0]; @@ -1820,13 +1807,6 @@ ArrayList<ArrayList<MorphRetained>> morphUserLists = null; " alpha " + alpha ); */ - // no need to update alpha values if canvas supports global alpha - - if (cv.supportGlobalAlpha()) { - cv.setGlobalAlpha(cv.ctx, alpha); - return mirrorUnsignedByteRefColors[0]; - } - // update alpha only if vertex format includes alpha if (((vertexFormat | c4fAllocated) & GeometryArray.WITH_ALPHA) == 0) return mirrorUnsignedByteRefColors[0]; @@ -1961,13 +1941,6 @@ ArrayList<ArrayList<MorphRetained>> morphUserLists = null; Object[] retVal = new Object[2]; retVal[0] = Boolean.FALSE; - // no need to update alpha values if canvas supports global alpha - if (cv.supportGlobalAlpha()) { - cv.setGlobalAlpha(cv.ctx, alpha); - retVal[1] = vertexData; - return retVal; - } - // update alpha only if vertex format includes alpha if ((vertexFormat & GeometryArray.COLOR) == 0) { retVal[1] = vertexData; @@ -2091,13 +2064,6 @@ ArrayList<ArrayList<MorphRetained>> morphUserLists = null; Object[] retVal = new Object[2]; retVal[0] = Boolean.FALSE; - // no need to update alpha values if canvas supports global alpha - if (cv.supportGlobalAlpha()) { - cv.setGlobalAlpha(cv.ctx, alpha); - retVal[1] = null; - return retVal; - } - // update alpha only if vertex format includes alpha if (((vertexFormat | c4fAllocated) & GeometryArray.WITH_ALPHA) == 0) { retVal[1] = mirrorInterleavedColorPointer[0]; diff --git a/src/classes/share/javax/media/j3d/GraphicsContext3D.java b/src/classes/share/javax/media/j3d/GraphicsContext3D.java index ef52e08..75b2d1d 100644 --- a/src/classes/share/javax/media/j3d/GraphicsContext3D.java +++ b/src/classes/share/javax/media/j3d/GraphicsContext3D.java @@ -2035,7 +2035,7 @@ public int numSounds() { if ((( geoRetained.vertexFormat & GeometryArray.BY_REFERENCE)!=0) && (geoRetained.c4fAllocated == 0) && ((geoRetained.vertexFormat & GeometryArray.COLOR) != 0) && - useAlpha && (canvas3d.extensionsSupported &Canvas3D.SUN_GLOBAL_ALPHA) == 0 ) { + useAlpha) { if ((geoRetained.vertexFormat & GeometryArray.INTERLEAVED) != 0) { geoRetained.setupMirrorInterleavedColorPointer(true); diff --git a/src/classes/share/javax/media/j3d/JoglPipeline.java b/src/classes/share/javax/media/j3d/JoglPipeline.java index ca7f5dc..d6c974e 100644 --- a/src/classes/share/javax/media/j3d/JoglPipeline.java +++ b/src/classes/share/javax/media/j3d/JoglPipeline.java @@ -402,15 +402,6 @@ class JoglPipeline extends Pipeline { gl.glDisableClientState(GL2.GL_COLOR_ARRAY); } -// FIXME: SUN_global_alpha -// if (gl.isExtensionAvailable("GL_SUN_global_alpha")) { -// if (useAlpha) { -// gl.glEnable(GL.GL_GLOBAL_ALPHA_SUN); -// } else { -// gl.glDisable(GL.GL_GLOBAL_ALPHA_SUN); -// } -// } - if ((vformat & GeometryArray.COORDINATES) != 0) { gl.glEnableClientState(GL2.GL_VERTEX_ARRAY); } else { @@ -418,22 +409,6 @@ class JoglPipeline extends Pipeline { } } - @Override - void disableGlobalAlpha(Context ctx, GeometryArrayRetained geo, int vformat, - boolean useAlpha, boolean ignoreVertexColors) { - if (VERBOSE) System.err.println("JoglPipeline.disableGlobalAlpha()"); -// FIXME: SUN_global_alpha -// GL gl = context(ctx).getGL(); - -// if (gl.isExtensionAvailable("GL_SUN_global_alpha")) { -// if (!ignoreVertexColors && ((vformat & GeometryArray.COLOR) != 0)) { -// if (useAlpha) { -// gl.glDisable(GL.GL_GLOBAL_ALPHA_SUN); -// } -// } -// } - } - // used for GeometryArrays @Override void buildGA(Context ctx, @@ -6984,17 +6959,6 @@ void swapBuffers(Canvas3D cv, Context ctx, Drawable drawable) { } } - @Override - void setGlobalAlpha(Context ctx, float alpha) { - if (VERBOSE) System.err.println("JoglPipeline.setGlobalAlpha()"); -// FIXME: SUN_global_alpha -// GL gl = context(ctx).getGL(); -// if (gl.isExtensionAvailable("GL_SUN_global_alpha")) { -// gl.glEnable(GL.GL_GLOBAL_ALPHA_SUN); -// gl.glGlobalAlphaFactorfSUN(alpha); -// } - } - // Native method to update separate specular color control @Override void updateSeparateSpecularColorEnable(Context ctx, boolean enable) { @@ -8207,12 +8171,6 @@ static boolean hasFBObjectSizeChanged(JoglDrawable jdraw, int width, int height) // Check shader extensions checkGLSLShaderExtensions(cv, ctx, gl, gl13); - // Setup GL_SUN_gloabl_alpha -// FIXME: SUN_global_alpha -// if (gl.isExtensionAvailable("GL_SUN_gloabl_alpha")) { -// cv.extensionsSupported |= Canvas3D.SUN_GLOBAL_ALPHA; -// } - cv.textureBoundaryWidthMax = 1; { int[] tmp = new int[1]; @@ -8268,11 +8226,6 @@ static boolean hasFBObjectSizeChanged(JoglDrawable jdraw, int width, int height) // if (gl.isExtensionAvailable("GL_SGI_texture_color_table")) { // gl.glDisable(GL.GL_TEXTURE_COLOR_TABLE_SGI); // } -// FIXME: SUN_global_alpha -// if (gl.isExtensionAvailable("GL_SUN_global_alpha")) { -// gl.glDisable(GL.GL_GLOBAL_ALPHA_SUN); -// } - } private void disableAttribForRaster(GL gl) { @@ -8288,10 +8241,6 @@ static boolean hasFBObjectSizeChanged(JoglDrawable jdraw, int width, int height) // gl.glDisable(GL2.GL_CLIP_PLANE0 + i); // } -// FIXME: SUN_global_alpha -// if (gl.isExtensionAvailable("GL_SUN_global_alpha")) { -// gl.glDisable(GL.GL_GLOBAL_ALPHA_SUN); -// } } private void copyTranspose(double[] src, double[] dst) { diff --git a/src/classes/share/javax/media/j3d/NoopPipeline.java b/src/classes/share/javax/media/j3d/NoopPipeline.java index 055cb69..64c0ccd 100644 --- a/src/classes/share/javax/media/j3d/NoopPipeline.java +++ b/src/classes/share/javax/media/j3d/NoopPipeline.java @@ -140,11 +140,6 @@ class NoopPipeline extends Pipeline { int vformat, boolean useAlpha, boolean ignoreVertexColors) { } - @Override - void disableGlobalAlpha(Context ctx, GeometryArrayRetained geo, int vformat, - boolean useAlpha, boolean ignoreVertexColors) { - } - // used for GeometryArrays @Override void buildGA(Context ctx, @@ -1143,10 +1138,6 @@ void swapBuffers(Canvas3D cv, Context ctx, Drawable drawable) {} void setFullSceneAntialiasing(Context ctx, boolean enable) { } - @Override - void setGlobalAlpha(Context ctx, float alpha) { - } - // Native method to update separate specular color control @Override void updateSeparateSpecularColorEnable(Context ctx, boolean control) { diff --git a/src/classes/share/javax/media/j3d/OrientedShape3DRenderMethod.java b/src/classes/share/javax/media/j3d/OrientedShape3DRenderMethod.java index ae85f8c..afa7ad8 100644 --- a/src/classes/share/javax/media/j3d/OrientedShape3DRenderMethod.java +++ b/src/classes/share/javax/media/j3d/OrientedShape3DRenderMethod.java @@ -110,12 +110,6 @@ class OrientedShape3DRenderMethod implements RenderMethod { ra = ra.next; } - - - geo.disableGlobalAlpha(cv.ctx, - (rm.useAlpha && - ((geo.vertexFormat & GeometryArray.COLOR) != 0)), - rm.textureBin.attributeBin.ignoreVertexColors); return isVisible; } } diff --git a/src/classes/share/javax/media/j3d/Pipeline.java b/src/classes/share/javax/media/j3d/Pipeline.java index 45596e5..4804156 100644 --- a/src/classes/share/javax/media/j3d/Pipeline.java +++ b/src/classes/share/javax/media/j3d/Pipeline.java @@ -229,9 +229,6 @@ public Pipeline run() { abstract void setVertexFormat(Context ctx, GeometryArrayRetained geo, int vformat, boolean useAlpha, boolean ignoreVertexColors); - abstract void disableGlobalAlpha(Context ctx, GeometryArrayRetained geo, int vformat, - boolean useAlpha, boolean ignoreVertexColors); - // used for GeometryArrays abstract void buildGA(Context ctx, GeometryArrayRetained geo, int geo_type, @@ -1007,8 +1004,6 @@ public Pipeline run() { // Setup the full scene antialising in D3D and ogl when GL_ARB_multisamle supported abstract void setFullSceneAntialiasing(Context ctx, boolean enable); - abstract void setGlobalAlpha(Context ctx, float alpha); - // Native method to update separate specular color control abstract void updateSeparateSpecularColorEnable(Context ctx, boolean control); diff --git a/src/classes/share/javax/media/j3d/RenderBin.java b/src/classes/share/javax/media/j3d/RenderBin.java index fe7cf2f..aacef06 100644 --- a/src/classes/share/javax/media/j3d/RenderBin.java +++ b/src/classes/share/javax/media/j3d/RenderBin.java @@ -607,7 +607,6 @@ private LinkedHashSet<RenderAtom> dirtyDepthSortRenderAtom = new LinkedHashSet<R // Do the setup only once{if necessary} for each geometry boolean found = false; while(j < canvases.length && !found) { - if ((canvases[j].extensionsSupported & Canvas3D.SUN_GLOBAL_ALPHA) == 0) { if ((geo.vertexFormat & GeometryArray.INTERLEAVED) != 0) { geo.setupMirrorInterleavedColorPointer(true); found = true; @@ -616,7 +615,6 @@ private LinkedHashSet<RenderAtom> dirtyDepthSortRenderAtom = new LinkedHashSet<R geo.setupMirrorColorPointer((geo.vertexType & GeometryArrayRetained.COLOR_DEFINED),true); found = true; } - } j++; } geo.geomLock.unLock(); diff --git a/src/classes/share/javax/media/j3d/Text3DRenderMethod.java b/src/classes/share/javax/media/j3d/Text3DRenderMethod.java index 99f6e5c..6b2d2dc 100644 --- a/src/classes/share/javax/media/j3d/Text3DRenderMethod.java +++ b/src/classes/share/javax/media/j3d/Text3DRenderMethod.java @@ -109,12 +109,6 @@ class Text3DRenderMethod implements RenderMethod { ra = ra.next; } - - geo.disableGlobalAlpha(cv.ctx, - (rm.useAlpha && ((geo.vertexFormat & - GeometryArray.COLOR) != 0)), - rm.textureBin.attributeBin.ignoreVertexColors); - return isVisible; } } diff --git a/src/classes/share/javax/media/j3d/VertexArrayRenderMethod.java b/src/classes/share/javax/media/j3d/VertexArrayRenderMethod.java index ff99bb7..bdf937b 100644 --- a/src/classes/share/javax/media/j3d/VertexArrayRenderMethod.java +++ b/src/classes/share/javax/media/j3d/VertexArrayRenderMethod.java @@ -77,10 +77,6 @@ class VertexArrayRenderMethod implements RenderMethod { ra = ra.next; } - geo.disableGlobalAlpha(cv.ctx, - (rm.useAlpha && ((geo.vertexFormat & - GeometryArray.COLOR) != 0)), - rm.textureBin.attributeBin.ignoreVertexColors); return isVisible; } |