Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab7b4fe4 authored by Narayan Kamath's avatar Narayan Kamath Committed by Android Git Automerger
Browse files

am 097b5991: am e5c99bf3: Merge "Use long for pointers in opengl/EGL classes"

* commit '097b5991':
  Use long for pointers in opengl/EGL classes
parents 580c1c59 097b5991
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -57,8 +57,8 @@ public class JType {
    typeMapping.put(new CType("EGLenum"), new JType("int"));
    typeMapping.put(new CType("EGLNativePixmapType"), new JType("int"));
    typeMapping.put(new CType("EGLNativeWindowType"), new JType("int"));
    typeMapping.put(new CType("EGLNativeDisplayType"), new JType("int"));
    typeMapping.put(new CType("EGLClientBuffer"), new JType("int"));
    typeMapping.put(new CType("EGLNativeDisplayType"), new JType("long"));
    typeMapping.put(new CType("EGLClientBuffer"), new JType("long"));
    typeMapping.put(new CType("EGLnsecsANDROID"), new JType("long"));

    // EGL nonprimitive types
+2 −2
Original line number Diff line number Diff line
@@ -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();
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -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();
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -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();
    }
}
+28 −4
Original line number Diff line number Diff line
@@ -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;
    }
}
Loading