diff options
author | Andy McFadden <fadden@android.com> | 2013-06-21 16:02:11 -0700 |
---|---|---|
committer | Andy McFadden <fadden@android.com> | 2013-06-21 16:22:02 -0700 |
commit | 9a90aa9003f8b53a6e8ce20f97ef3ba87891697a (patch) | |
tree | 7a1fcb2ab082f1bc5a62b856f72a0e2141a63ab2 /opengl | |
parent | 1705fc44fb85c4232637f9f7189c3bdca98a63d5 (diff) | |
download | frameworks_native-9a90aa9003f8b53a6e8ce20f97ef3ba87891697a.zip frameworks_native-9a90aa9003f8b53a6e8ce20f97ef3ba87891697a.tar.gz frameworks_native-9a90aa9003f8b53a6e8ce20f97ef3ba87891697a.tar.bz2 |
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
Diffstat (limited to 'opengl')
-rwxr-xr-x | opengl/tools/glgen/gen | 14 | ||||
-rw-r--r-- | opengl/tools/glgen/static/egl/EGLConfig.java | 2 | ||||
-rw-r--r-- | opengl/tools/glgen/static/egl/EGLContext.java | 2 | ||||
-rw-r--r-- | opengl/tools/glgen/static/egl/EGLDisplay.java | 2 | ||||
-rw-r--r-- | opengl/tools/glgen/static/egl/EGLSurface.java | 2 |
5 files changed, 12 insertions, 10 deletions
diff --git a/opengl/tools/glgen/gen b/opengl/tools/glgen/gen index d236c1e..7146a29 100755 --- a/opengl/tools/glgen/gen +++ b/opengl/tools/glgen/gen @@ -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 diff --git a/opengl/tools/glgen/static/egl/EGLConfig.java b/opengl/tools/glgen/static/egl/EGLConfig.java index d457c9f..a7a6bbb 100644 --- a/opengl/tools/glgen/static/egl/EGLConfig.java +++ b/opengl/tools/glgen/static/egl/EGLConfig.java @@ -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(); diff --git a/opengl/tools/glgen/static/egl/EGLContext.java b/opengl/tools/glgen/static/egl/EGLContext.java index 41b8ef1..c93bd6e 100644 --- a/opengl/tools/glgen/static/egl/EGLContext.java +++ b/opengl/tools/glgen/static/egl/EGLContext.java @@ -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(); diff --git a/opengl/tools/glgen/static/egl/EGLDisplay.java b/opengl/tools/glgen/static/egl/EGLDisplay.java index 17d1a64..5b8043a 100644 --- a/opengl/tools/glgen/static/egl/EGLDisplay.java +++ b/opengl/tools/glgen/static/egl/EGLDisplay.java @@ -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(); diff --git a/opengl/tools/glgen/static/egl/EGLSurface.java b/opengl/tools/glgen/static/egl/EGLSurface.java index 65bec4f..c379dc9 100644 --- a/opengl/tools/glgen/static/egl/EGLSurface.java +++ b/opengl/tools/glgen/static/egl/EGLSurface.java @@ -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(); |