diff options
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/java/android/opengl/EGL14.java | 22 | ||||
-rw-r--r-- | opengl/java/android/opengl/EGLConfig.java | 4 | ||||
-rw-r--r-- | opengl/java/android/opengl/EGLContext.java | 4 | ||||
-rw-r--r-- | opengl/java/android/opengl/EGLDisplay.java | 4 | ||||
-rw-r--r-- | opengl/java/android/opengl/EGLObjectHandle.java | 32 | ||||
-rw-r--r-- | opengl/java/android/opengl/EGLSurface.java | 4 |
6 files changed, 57 insertions, 13 deletions
diff --git a/opengl/java/android/opengl/EGL14.java b/opengl/java/android/opengl/EGL14.java index b93557d..b6dd9c2 100644 --- a/opengl/java/android/opengl/EGL14.java +++ b/opengl/java/android/opengl/EGL14.java @@ -155,10 +155,18 @@ public static final int EGL_CORE_NATIVE_ENGINE = 0x305B; ); // C function EGLDisplay eglGetDisplay ( EGLNativeDisplayType display_id ) + // TODO Deprecate the eglGetDisplay(int) API method public static native EGLDisplay eglGetDisplay( int display_id ); + // TODO Unhide the eglGetDisplay(long) API method + /** + * {@hide} + */ + public static native EGLDisplay eglGetDisplay( + long display_id + ); // C function EGLBoolean eglInitialize ( EGLDisplay dpy, EGLint *major, EGLint *minor ) @@ -324,7 +332,7 @@ public static final int EGL_CORE_NATIVE_ENGINE = 0x305B; ); // C function EGLSurface eglCreatePbufferFromClientBuffer ( EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list ) - + // TODO Deprecate the below method public static native EGLSurface eglCreatePbufferFromClientBuffer( EGLDisplay dpy, int buftype, @@ -333,6 +341,18 @@ public static final int EGL_CORE_NATIVE_ENGINE = 0x305B; int[] attrib_list, int offset ); + // TODO Unhide the below method + /** + * {@hide} + */ + public static native EGLSurface eglCreatePbufferFromClientBuffer( + EGLDisplay dpy, + int buftype, + long buffer, + EGLConfig config, + int[] attrib_list, + int offset + ); // C function EGLBoolean eglSurfaceAttrib ( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value ) diff --git a/opengl/java/android/opengl/EGLConfig.java b/opengl/java/android/opengl/EGLConfig.java index a7a6bbb..9881070 100644 --- a/opengl/java/android/opengl/EGLConfig.java +++ b/opengl/java/android/opengl/EGLConfig.java @@ -22,7 +22,7 @@ package android.opengl; * */ public class EGLConfig extends EGLObjectHandle { - private EGLConfig(int handle) { + private EGLConfig(long handle) { super(handle); } @@ -32,6 +32,6 @@ public class EGLConfig extends EGLObjectHandle { if (!(o instanceof EGLConfig)) return false; EGLConfig that = (EGLConfig) o; - return getHandle() == that.getHandle(); + return getNativeHandle() == that.getNativeHandle(); } } diff --git a/opengl/java/android/opengl/EGLContext.java b/opengl/java/android/opengl/EGLContext.java index c93bd6e..f791e7e 100644 --- a/opengl/java/android/opengl/EGLContext.java +++ b/opengl/java/android/opengl/EGLContext.java @@ -22,7 +22,7 @@ package android.opengl; * */ public class EGLContext extends EGLObjectHandle { - private EGLContext(int handle) { + private EGLContext(long handle) { super(handle); } @@ -32,6 +32,6 @@ public class EGLContext extends EGLObjectHandle { if (!(o instanceof EGLContext)) return false; EGLContext that = (EGLContext) o; - return getHandle() == that.getHandle(); + return getNativeHandle() == that.getNativeHandle(); } } diff --git a/opengl/java/android/opengl/EGLDisplay.java b/opengl/java/android/opengl/EGLDisplay.java index 5b8043a..e872761 100644 --- a/opengl/java/android/opengl/EGLDisplay.java +++ b/opengl/java/android/opengl/EGLDisplay.java @@ -22,7 +22,7 @@ package android.opengl; * */ public class EGLDisplay extends EGLObjectHandle { - private EGLDisplay(int handle) { + private EGLDisplay(long handle) { super(handle); } @@ -32,6 +32,6 @@ public class EGLDisplay extends EGLObjectHandle { if (!(o instanceof EGLDisplay)) return false; EGLDisplay that = (EGLDisplay) o; - return getHandle() == that.getHandle(); + return getNativeHandle() == that.getNativeHandle(); } } diff --git a/opengl/java/android/opengl/EGLObjectHandle.java b/opengl/java/android/opengl/EGLObjectHandle.java index d2710de..e6e3976 100644 --- a/opengl/java/android/opengl/EGLObjectHandle.java +++ b/opengl/java/android/opengl/EGLObjectHandle.java @@ -22,12 +22,20 @@ package android.opengl; * */ public abstract class EGLObjectHandle { - private final int mHandle; + private final long mHandle; + // TODO Deprecate EGLObjectHandle(int) method protected EGLObjectHandle(int handle) { mHandle = handle; } - + // TODO Unhide the EGLObjectHandle(long) method + /** + * {@hide} + */ + protected EGLObjectHandle(long handle) { + mHandle = handle; + } + // TODO Deprecate getHandle() method in favor of getNativeHandle() /** * Returns the native handle of the wrapped EGL object. This handle can be * cast to the corresponding native type on the native side. @@ -37,11 +45,27 @@ public abstract class EGLObjectHandle { * @return the native handle of the wrapped EGL object. */ public int getHandle() { - return mHandle; + if ((mHandle & 0xffffffffL) != mHandle) { + throw new UnsupportedOperationException(); + } + return (int)mHandle; } + // TODO Unhide getNativeHandle() method + /** + * {@hide} + */ + public long getNativeHandle() { + return mHandle; + } @Override public int hashCode() { - return getHandle(); + /* + * Based on the algorithm suggested in + * http://developer.android.com/reference/java/lang/Object.html + */ + int result = 17; + result = 31 * result + (int) (mHandle ^ (mHandle >>> 32)); + return result; } } diff --git a/opengl/java/android/opengl/EGLSurface.java b/opengl/java/android/opengl/EGLSurface.java index c379dc9..c200f72 100644 --- a/opengl/java/android/opengl/EGLSurface.java +++ b/opengl/java/android/opengl/EGLSurface.java @@ -22,7 +22,7 @@ package android.opengl; * */ public class EGLSurface extends EGLObjectHandle { - private EGLSurface(int handle) { + private EGLSurface(long handle) { super(handle); } @@ -32,6 +32,6 @@ public class EGLSurface extends EGLObjectHandle { if (!(o instanceof EGLSurface)) return false; EGLSurface that = (EGLSurface) o; - return getHandle() == that.getHandle(); + return getNativeHandle() == that.getNativeHandle(); } } |