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

Commit b28648c6 authored by Courtney Goeltzenleuchter's avatar Courtney Goeltzenleuchter
Browse files

Generated EGL 1.5 support

After updating opengl/tools/glgen2/registry/egl.xml and gl.xml do:
cd opengl/tools/glgen
./gen
cd ../glgen2
./glgen.py

Note: Manually undo delete of glMultiDrawElementsBaseVertexOES.
EGL removed that as an API
(https://github.com/KhronosGroup/OpenGL-Registry/issues/81) but
we can't remove or we'd break backward compatibility.

Test: compile
Bug: 80239516

Change-Id: I6fa125ef076ad4ce5b53833ac6aef2f87edaf656
(cherry picked from commit ed87ada59b97ccfcabec8133fb026144a728a77c)
parent edf87c18
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ rm src/*.class
pushd out > /dev/null
mkdir classes
javac -d classes    android/opengl/EGL14.java \
                    android/opengl/EGL15.java \
                    android/opengl/EGLExt.java \
                    com/google/android/gles_jni/GLImpl.java \
                    javax/microedition/khronos/opengles/GL10.java \
@@ -155,13 +156,13 @@ do
    compareGenerated ../../../../base/opengl/java/javax/microedition/khronos/opengles generated/javax/microedition/khronos/opengles $x
done

for x in EGL14 EGLExt GLES10 GLES10Ext GLES11 GLES11Ext GLES20 GLES30 GLES31 GLES31Ext GLES32
for x in EGL14 EGL15 EGLExt GLES10 GLES10Ext GLES11 GLES11Ext GLES20 GLES30 GLES31 GLES31Ext GLES32
do
    compareGenerated ../../../../base/opengl/java/android/opengl generated/android/opengl ${x}.java
    compareGenerated ../../../../base/core/jni generated/C android_opengl_${x}.cpp
done

for x in EGLConfig EGLContext EGLDisplay EGLObjectHandle EGLSurface
for x in EGLConfig EGLContext EGLDisplay EGLObjectHandle EGLSurface EGLImage EGLSync
do
    compareGenerated ../../../../base/opengl/java/android/opengl generated/android/opengl ${x}.java
done
+12 −0
Original line number Diff line number Diff line
EGLSync eglCreateSync ( EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list )
EGLBoolean eglDestroySync ( EGLDisplay dpy, EGLSync sync )
EGLint eglClientWaitSync ( EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout )
EGLBoolean eglGetSyncAttrib ( EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value )
// NOTE: native_display isn't actually an EGLAttrib. Using EGLAttrib
// so that the generate creates mostly correct code (do not want a buffer)
// have to manually change cast to (void *) in generated code that calls
// the native function.
EGLDisplay eglGetPlatformDisplay ( EGLenum platform, EGLAttrib native_display, const EGLAttrib *attrib_list )
EGLSurface eglCreatePlatformWindowSurface ( EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list )
EGLSurface eglCreatePlatformPixmapSurface ( EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list )
EGLBoolean eglWaitSync ( EGLDisplay dpy, EGLSync sync, EGLint flags )
+3 −1
Original line number Diff line number Diff line
@@ -57,7 +57,9 @@ public class CType {
        if(baseType.equals("EGLContext")
           || baseType.equals("EGLConfig")
           || baseType.equals("EGLSurface")
           || baseType.equals("EGLDisplay")) {
           || baseType.equals("EGLDisplay")
           || baseType.equals("EGLImage")
           || baseType.equals("EGLSync")) {
               return true;
        }
        return false;
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ public class GenerateEGL {
        ParameterChecker checker = new ParameterChecker(checksReader);


        for(String suffix: new String[] {"EGL14", "EGLExt"}) {
        for(String suffix: new String[] {"EGL14", "EGL15", "EGLExt"}) {
            BufferedReader specReader = new BufferedReader(new FileReader(
                    "specs/egl/" + suffix + ".spec"));
            String egljFilename = "android/opengl/" + suffix + ".java";
+6 −0
Original line number Diff line number Diff line
@@ -60,12 +60,16 @@ public class JType {
    typeMapping.put(new CType("EGLNativeDisplayType"), new JType("long"));
    typeMapping.put(new CType("EGLClientBuffer"), new JType("long"));
    typeMapping.put(new CType("EGLnsecsANDROID"), new JType("long"));
    typeMapping.put(new CType("EGLAttrib"), new JType("long"));
    typeMapping.put(new CType("EGLTime"), new JType("long"));

    // EGL nonprimitive types
    typeMapping.put(new CType("EGLConfig"), new JType("EGLConfig", true, false));
    typeMapping.put(new CType("EGLContext"), new JType("EGLContext", true, false));
    typeMapping.put(new CType("EGLDisplay"), new JType("EGLDisplay", true, false));
    typeMapping.put(new CType("EGLSurface"), new JType("EGLSurface", true, false));
    typeMapping.put(new CType("EGLImage"), new JType("EGLImage", true, false));
    typeMapping.put(new CType("EGLSync"), new JType("EGLSync", true, false));


    // Untyped pointers map to untyped Buffers
@@ -139,6 +143,8 @@ public class JType {
    arrayTypeMapping.put(new CType("EGLint", true, true), new JType("int", false, true));
    arrayTypeMapping.put(new CType("EGLConfig", false, true), new JType("EGLConfig", true, true));
    arrayTypeMapping.put(new CType("EGLConfig", true, true), new JType("EGLConfig", true, true));
    arrayTypeMapping.put(new CType("EGLAttrib", false, true), new JType("long", false, true));
    arrayTypeMapping.put(new CType("EGLAttrib", true, true), new JType("long", false, true));

    }

Loading