1 /*
2 ** Copyright 2018, The Android Open Source Project
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 **     http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
17 package android.opengl;
18 
19 /**
20  * EGL 1.5
21  *
22  */
23 public final class EGL15 {
24 
EGL15()25     private EGL15() {};
26 
27     public static final int EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT            = 0x00000001;
28     public static final int EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT   = 0x00000002;
29     public static final int EGL_OPENGL_ES3_BIT                             = 0x00000040;
30     public static final int EGL_SYNC_FLUSH_COMMANDS_BIT                    = 0x0001;
31     public static final int EGL_GL_COLORSPACE_SRGB                         = 0x3089;
32     public static final int EGL_GL_COLORSPACE_LINEAR                       = 0x308A;
33     public static final int EGL_CONTEXT_MAJOR_VERSION                      = 0x3098;
34     public static final int EGL_CL_EVENT_HANDLE                            = 0x309C;
35     public static final int EGL_GL_COLORSPACE                              = 0x309D;
36     public static final int EGL_GL_TEXTURE_2D                              = 0x30B1;
37     public static final int EGL_GL_TEXTURE_3D                              = 0x30B2;
38     public static final int EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X             = 0x30B3;
39     public static final int EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X             = 0x30B4;
40     public static final int EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y             = 0x30B5;
41     public static final int EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y             = 0x30B6;
42     public static final int EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z             = 0x30B7;
43     public static final int EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z             = 0x30B8;
44     public static final int EGL_GL_RENDERBUFFER                            = 0x30B9;
45     public static final int EGL_GL_TEXTURE_LEVEL                           = 0x30BC;
46     public static final int EGL_GL_TEXTURE_ZOFFSET                         = 0x30BD;
47     public static final int EGL_IMAGE_PRESERVED                            = 0x30D2;
48     public static final int EGL_SYNC_PRIOR_COMMANDS_COMPLETE               = 0x30F0;
49     public static final int EGL_SYNC_STATUS                                = 0x30F1;
50     public static final int EGL_SIGNALED                                   = 0x30F2;
51     public static final int EGL_UNSIGNALED                                 = 0x30F3;
52     public static final int EGL_TIMEOUT_EXPIRED                            = 0x30F5;
53     public static final int EGL_CONDITION_SATISFIED                        = 0x30F6;
54     public static final int EGL_SYNC_TYPE                                  = 0x30F7;
55     public static final int EGL_SYNC_CONDITION                             = 0x30F8;
56     public static final int EGL_SYNC_FENCE                                 = 0x30F9;
57     public static final int EGL_CONTEXT_MINOR_VERSION                      = 0x30FB;
58     public static final int EGL_CONTEXT_OPENGL_PROFILE_MASK                = 0x30FD;
59     public static final int EGL_SYNC_CL_EVENT                              = 0x30FE;
60     public static final int EGL_SYNC_CL_EVENT_COMPLETE                     = 0x30FF;
61     public static final int EGL_CONTEXT_OPENGL_DEBUG                       = 0x31B0;
62     public static final int EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE          = 0x31B1;
63     public static final int EGL_CONTEXT_OPENGL_ROBUST_ACCESS               = 0x31B2;
64     public static final int EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY = 0x31BD;
65     public static final int EGL_NO_RESET_NOTIFICATION                      = 0x31BE;
66     public static final int EGL_LOSE_CONTEXT_ON_RESET                      = 0x31BF;
67     public static final int EGL_PLATFORM_ANDROID_KHR                       = 0x3141;
68     public static final long EGL_FOREVER                                   = 0xFFFFFFFFFFFFFFFFL;
69     public static final EGLImage EGL_NO_IMAGE                              = null;
70     public static final EGLSync EGL_NO_SYNC                                = null;
71     public static final EGLContext EGL_NO_CONTEXT                          = null;
72     public static final EGLDisplay EGL_NO_DISPLAY                          = null;
73     public static final EGLSurface EGL_NO_SURFACE                          = null;
74 
_nativeClassInit()75     native private static void _nativeClassInit();
76     static {
_nativeClassInit()77         _nativeClassInit();
78     }
79     // C function EGLSync eglCreateSync ( EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list )
80 
eglCreateSync( EGLDisplay dpy, int type, long[] attrib_list, int offset )81     public static native EGLSync eglCreateSync(
82         EGLDisplay dpy,
83         int type,
84         long[] attrib_list,
85         int offset
86     );
87 
88     /**
89     * C function EGLBoolean eglGetSyncAttrib ( EGLDisplay dpy, EGLSync sync, EGLint attribute,
90     *                                          EGLAttrib *value )
91     */
92 
eglGetSyncAttrib( EGLDisplay dpy, EGLSync sync, int attribute, long[] value, int offset )93     public static native boolean eglGetSyncAttrib(
94             EGLDisplay dpy,
95             EGLSync sync,
96             int attribute,
97             long[] value,
98             int offset
99     );
100 
101     // C function EGLBoolean eglDestroySync ( EGLDisplay dpy, EGLSync sync )
102 
eglDestroySync( EGLDisplay dpy, EGLSync sync )103     public static native boolean eglDestroySync(
104         EGLDisplay dpy,
105         EGLSync sync
106     );
107 
108     // C function EGLint eglClientWaitSync ( EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout )
109 
eglClientWaitSync( EGLDisplay dpy, EGLSync sync, int flags, long timeout )110     public static native int eglClientWaitSync(
111         EGLDisplay dpy,
112         EGLSync sync,
113         int flags,
114         long timeout
115     );
116 
117     // C function EGLDisplay eglGetPlatformDisplay ( EGLenum platform, EGLAttrib native_display, const EGLAttrib *attrib_list )
118 
eglGetPlatformDisplay( int platform, long native_display, long[] attrib_list, int offset )119     public static native EGLDisplay eglGetPlatformDisplay(
120         int platform,
121         long native_display,
122         long[] attrib_list,
123         int offset
124     );
125 
126     // C function EGLSurface eglCreatePlatformWindowSurface ( EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list )
127 
eglCreatePlatformWindowSurface( EGLDisplay dpy, EGLConfig config, java.nio.Buffer native_window, long[] attrib_list, int offset )128     public static native EGLSurface eglCreatePlatformWindowSurface(
129         EGLDisplay dpy,
130         EGLConfig config,
131         java.nio.Buffer native_window,
132         long[] attrib_list,
133         int offset
134     );
135 
136     // C function EGLSurface eglCreatePlatformPixmapSurface ( EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list )
137 
eglCreatePlatformPixmapSurface( EGLDisplay dpy, EGLConfig config, java.nio.Buffer native_pixmap, long[] attrib_list, int offset )138     public static native EGLSurface eglCreatePlatformPixmapSurface(
139         EGLDisplay dpy,
140         EGLConfig config,
141         java.nio.Buffer native_pixmap,
142         long[] attrib_list,
143         int offset
144     );
145 
146     // C function EGLBoolean eglWaitSync ( EGLDisplay dpy, EGLSync sync, EGLint flags )
147 
eglWaitSync( EGLDisplay dpy, EGLSync sync, int flags )148     public static native boolean eglWaitSync(
149         EGLDisplay dpy,
150         EGLSync sync,
151         int flags
152     );
153 
154     // C function EGLImage eglCreateImage ( EGLDisplay dpy, EGLContext context, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list )
155 
eglCreateImage( EGLDisplay dpy, EGLContext context, int target, long buffer, long[] attrib_list, int offset )156     public static native EGLImage eglCreateImage(
157         EGLDisplay dpy,
158         EGLContext context,
159         int target,
160         long buffer,
161         long[] attrib_list,
162         int offset
163     );
164 
165     // C function EGLBoolean eglDestroyImage ( EGLDisplay dpy, EGLImage image )
166 
eglDestroyImage( EGLDisplay dpy, EGLImage image )167     public static native boolean eglDestroyImage(
168         EGLDisplay dpy,
169         EGLImage image
170     );
171 
172 }
173