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

Commit 9a90aa90 authored by Andy McFadden's avatar Andy McFadden
Browse files

Fix wrapper equals()

Make it faster and correcter.

Also, fixed the "gen" script to update the static/egl/*.java files
as part of doing an update.  Altered the "git" lines to change
directories before invoking git -- necessary because we're now
split between frameworks/base and frameworks/native.

Bug 9204146

Change-Id: Ie60504b1932349e6f2c9d3868dee6a645ef2b36e
parent 1705fc44
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -32,10 +32,6 @@ echo "package android.os; public class RemoteException extends Exception {}" > o
echo "package android.util; public class Log {public static void w(String a, String b) {} public static void e(String a, String b) {}}" > out/android/util/Log.java

echo "package android.opengl; public abstract class EGLObjectHandle { public int getHandle() { return 0; } }" > out/android/opengl/EGLObjectHandle.java
echo "package android.opengl; public class EGLSurface extends EGLObjectHandle {  }" > out/android/opengl/EGLSurface.java
echo "package android.opengl; public class EGLContext extends EGLObjectHandle {  }" > out/android/opengl/EGLContext.java
echo "package android.opengl; public class EGLDisplay extends EGLObjectHandle {  }" > out/android/opengl/EGLDisplay.java
echo "package android.opengl; public class EGLConfig extends EGLObjectHandle {  }" > out/android/opengl/EGLConfig.java


echo "package android.graphics;" > out/android/graphics/SurfaceTexture.java
@@ -47,6 +43,7 @@ echo "public interface Surface {}" >> out/android/view/Surface.java
echo "package android.view;" > out/android/view/SurfaceHolder.java
echo "public interface SurfaceHolder { Surface getSurface(); }" >> out/android/view/SurfaceHolder.java

cp static/egl/*.java out/android/opengl/

GLFILE=out/javax/microedition/khronos/opengles/GL.java
cp stubs/jsr239/GLHeader.java-if $GLFILE
@@ -141,8 +138,8 @@ compareGenerated() {
            echo
            SAID_PLEASE=1
        fi
        echo "    " cp $2/$3 $1
        echo "    " git add $1/$3
        echo "    cp $2/$3 $1"
        echo "    (cd $1; git add $3)"
        KEEP_GENERATED=1
    fi
}
@@ -161,6 +158,11 @@ do
    compareGenerated ../../../../base/core/jni generated/C android_opengl_${x}.cpp
done

for x in EGLConfig EGLContext EGLDisplay EGLObjectHandle EGLSurface
do
    compareGenerated ../../../../base/opengl/java/android/opengl generated/android/opengl ${x}.java
done

if [ $KEEP_GENERATED == "0" ] ; then
    rm -rf generated
fi
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ public class EGLConfig extends EGLObjectHandle {
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!(o instanceof EGLConfig)) return false;

        EGLConfig that = (EGLConfig) o;
        return getHandle() == that.getHandle();
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ public class EGLContext extends EGLObjectHandle {
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!(o instanceof EGLContext)) return false;

        EGLContext that = (EGLContext) o;
        return getHandle() == that.getHandle();
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ public class EGLDisplay extends EGLObjectHandle {
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!(o instanceof EGLDisplay)) return false;

        EGLDisplay that = (EGLDisplay) o;
        return getHandle() == that.getHandle();
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ public class EGLSurface extends EGLObjectHandle {
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!(o instanceof EGLSurface)) return false;

        EGLSurface that = (EGLSurface) o;
        return getHandle() == that.getHandle();