diff options
author | Harvey Harrison <[email protected]> | 2012-06-23 23:41:44 -0700 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2012-06-23 23:41:44 -0700 |
commit | e563fd2bd10490586e908b28dd066361bdab00cf (patch) | |
tree | 451f08d1b52c85e6d35a03be140186103ecb5465 | |
parent | 33027fead23e06db2fc3990d04fe99157f087dd9 (diff) |
j3dcore: cleanup a feature test in J3DBuffer
Signed-off-by: Harvey Harrison <[email protected]>
-rw-r--r-- | src/classes/share/javax/media/j3d/J3DBuffer.java | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/src/classes/share/javax/media/j3d/J3DBuffer.java b/src/classes/share/javax/media/j3d/J3DBuffer.java index a963622..b46874c 100644 --- a/src/classes/share/javax/media/j3d/J3DBuffer.java +++ b/src/classes/share/javax/media/j3d/J3DBuffer.java @@ -60,12 +60,22 @@ public class J3DBuffer { static final int TYPE_FLOAT = 7; static final int TYPE_DOUBLE = 8; - static boolean unsupportedOperation = false; - private java.nio.Buffer originalBuffer = null; private BufferWrapper bufferImpl = null; private int bufferType = TYPE_NULL; +private static final boolean unsupportedOperation; + +static { + // Allocate a direct byte buffer and verify that we can + // access the data pointer from native code + java.nio.ByteBuffer buffer = java.nio.ByteBuffer.allocateDirect(8); + if (buffer == null) + unsupportedOperation = true; + else + unsupportedOperation = false; +} + /** * Constructs a J3DBuffer object and initializes it with * a null NIO buffer object. The NIO buffer object @@ -219,23 +229,4 @@ public class J3DBuffer { BufferWrapper getBufferImpl() { return bufferImpl; } - - private static boolean checkNativeBufferAccess(java.nio.Buffer buffer) { - if (buffer == null /*|| !Pipeline.getPipeline().checkNativeBufferAccess(buffer)*/) { - return false; - } - else { - return true; - } - } - - static { - // Allocate a direct byte buffer and verify that we can - // access the data pointer from native code - java.nio.ByteBuffer buffer = java.nio.ByteBuffer.allocateDirect(8); - - if (!checkNativeBufferAccess(buffer)) { - unsupportedOperation = true; - } - } } |