diff options
author | Jesse Hall <jessehall@google.com> | 2013-02-08 11:13:46 -0800 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2013-02-12 16:36:53 -0800 |
commit | 4774338bd0ad1ebe42c311fd0c72f13786b5c800 (patch) | |
tree | 52f851fe4cf9923fec6573ef7beea93928fdce4a /opengl/libs/EGL | |
parent | 61d1b812137b7f3a877e855f9a088be307ec11b6 (diff) | |
download | frameworks_native-4774338bd0ad1ebe42c311fd0c72f13786b5c800.tar.gz frameworks_native-4774338bd0ad1ebe42c311fd0c72f13786b5c800.tar.bz2 frameworks_native-4774338bd0ad1ebe42c311fd0c72f13786b5c800.zip |
Add ES3 support to libGLESv2 and tracing tools
Since ES3 is backwards compatible with ES2, a new wrapper isn't
necessary, and the Khronos implementation guidelines recommend
supporting both versions with the same library.
Change-Id: If9bb02be60ce01cc5fe25d1f40c4e7f37244ebf6
Diffstat (limited to 'opengl/libs/EGL')
-rw-r--r-- | opengl/libs/EGL/egl.cpp | 26 | ||||
-rw-r--r-- | opengl/libs/EGL/eglApi.cpp | 36 | ||||
-rw-r--r-- | opengl/libs/EGL/egl_display.h | 20 | ||||
-rw-r--r-- | opengl/libs/EGL/egl_object.cpp | 20 | ||||
-rw-r--r-- | opengl/libs/EGL/egl_object.h | 20 | ||||
-rw-r--r-- | opengl/libs/EGL/trace.cpp | 5 |
6 files changed, 58 insertions, 69 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index bf2477a64..a8691b5c9 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -1,16 +1,16 @@ -/* +/* ** Copyright 2007, The Android Open Source Project ** - ** Licensed under the Apache License, Version 2.0 (the "License"); - ** you may not use this file except in compliance with the License. - ** You may obtain a copy of the License at + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at ** - ** http://www.apache.org/licenses/LICENSE-2.0 + ** http://www.apache.org/licenses/LICENSE-2.0 ** - ** Unless required by applicable law or agreed to in writing, software - ** distributed under the License is distributed on an "AS IS" BASIS, - ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ** See the License for the specific language governing permissions and + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and ** limitations under the License. */ @@ -23,8 +23,6 @@ #include <EGL/egl.h> #include <EGL/eglext.h> -#include <GLES/gl.h> -#include <GLES/glext.h> #include <cutils/log.h> #include <cutils/atomic.h> @@ -232,7 +230,7 @@ static int gl_no_context() { return 0; } -static void early_egl_init(void) +static void early_egl_init(void) { #if !USE_FAST_TLS_KEY pthread_key_create(&gGLWrapperKey, NULL); @@ -243,8 +241,8 @@ static void early_egl_init(void) #endif uint32_t addr = (uint32_t)((void*)gl_no_context); android_memset32( - (uint32_t*)(void*)&gHooksNoContext, - addr, + (uint32_t*)(void*)&gHooksNoContext, + addr, sizeof(gHooksNoContext)); setGLHooksThreadSpecific(&gHooksNoContext); diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index 7a84651f6..ed9db9450 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -1,16 +1,16 @@ -/* +/* ** Copyright 2007, The Android Open Source Project ** - ** Licensed under the Apache License, Version 2.0 (the "License"); - ** you may not use this file except in compliance with the License. - ** You may obtain a copy of the License at + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at ** - ** http://www.apache.org/licenses/LICENSE-2.0 + ** http://www.apache.org/licenses/LICENSE-2.0 ** - ** Unless required by applicable law or agreed to in writing, software - ** distributed under the License is distributed on an "AS IS" BASIS, - ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ** See the License for the specific language governing permissions and + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and ** limitations under the License. */ @@ -25,8 +25,6 @@ #include <EGL/egl.h> #include <EGL/eglext.h> -#include <GLES/gl.h> -#include <GLES/glext.h> #include <cutils/log.h> #include <cutils/atomic.h> @@ -154,7 +152,7 @@ EGLBoolean eglTerminate(EGLDisplay dpy) if (!dp) return setError(EGL_BAD_DISPLAY, EGL_FALSE); EGLBoolean res = dp->terminate(); - + return res; } @@ -235,7 +233,7 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, if (attribRendererable && attribRendererable[1] == EGL_OPENGL_ES2_BIT && (!attribCaveat || attribCaveat[1] != EGL_NONE)) { - + // Insert 2 extra attributes to force-enable MSAA 4x EGLint aaAttribs[attribCount + 4]; aaAttribs[0] = EGL_SAMPLE_BUFFERS; @@ -272,7 +270,7 @@ EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, egl_connection_t* cnx = NULL; const egl_display_ptr dp = validate_display_connection(dpy, cnx); if (!dp) return EGL_FALSE; - + return cnx->egl.eglGetConfigAttrib( dp->disp.dpy, config, attribute, value); } @@ -371,7 +369,7 @@ EGLSurface eglCreatePbufferSurface( EGLDisplay dpy, EGLConfig config, } return EGL_NO_SURFACE; } - + EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface) { clearError(); @@ -457,7 +455,7 @@ EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, if (attr == EGL_CONTEXT_CLIENT_VERSION) { if (value == 1) { version = egl_connection_t::GLESv1_INDEX; - } else if (value == 2) { + } else if (value == 2 || value == 3) { version = egl_connection_t::GLESv2_INDEX; } } @@ -492,7 +490,7 @@ EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx) ContextRef _c(dp.get(), ctx); if (!_c.get()) return setError(EGL_BAD_CONTEXT, EGL_FALSE); - + egl_context_t * const c = get_context(ctx); EGLBoolean result = c->cnx->egl.eglDestroyContext(dp->disp.dpy, c->context); if (result == EGL_TRUE) { @@ -540,7 +538,7 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw, // these are the current objects structs egl_context_t * cur_c = get_context(getContext()); - + if (ctx != EGL_NO_CONTEXT) { c = get_context(ctx); impl_ctx = c->context; @@ -638,7 +636,7 @@ EGLSurface eglGetCurrentSurface(EGLint readdraw) if (!c) return setError(EGL_BAD_CONTEXT, EGL_NO_SURFACE); switch (readdraw) { case EGL_READ: return c->read; - case EGL_DRAW: return c->draw; + case EGL_DRAW: return c->draw; default: return setError(EGL_BAD_PARAMETER, EGL_NO_SURFACE); } } diff --git a/opengl/libs/EGL/egl_display.h b/opengl/libs/EGL/egl_display.h index 7bb09a3bb..8bb32f4c5 100644 --- a/opengl/libs/EGL/egl_display.h +++ b/opengl/libs/EGL/egl_display.h @@ -1,16 +1,16 @@ -/* +/* ** Copyright 2007, The Android Open Source Project ** - ** Licensed under the Apache License, Version 2.0 (the "License"); - ** you may not use this file except in compliance with the License. - ** You may obtain a copy of the License at + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at ** - ** http://www.apache.org/licenses/LICENSE-2.0 + ** http://www.apache.org/licenses/LICENSE-2.0 ** - ** Unless required by applicable law or agreed to in writing, software - ** distributed under the License is distributed on an "AS IS" BASIS, - ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ** See the License for the specific language governing permissions and + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and ** limitations under the License. */ @@ -24,8 +24,6 @@ #include <EGL/egl.h> #include <EGL/eglext.h> -#include <GLES/gl.h> -#include <GLES/glext.h> #include <cutils/compiler.h> #include <utils/SortedVector.h> diff --git a/opengl/libs/EGL/egl_object.cpp b/opengl/libs/EGL/egl_object.cpp index aaa5e7268..d3ee76d4d 100644 --- a/opengl/libs/EGL/egl_object.cpp +++ b/opengl/libs/EGL/egl_object.cpp @@ -1,16 +1,16 @@ -/* +/* ** Copyright 2007, The Android Open Source Project ** - ** Licensed under the Apache License, Version 2.0 (the "License"); - ** you may not use this file except in compliance with the License. - ** You may obtain a copy of the License at + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at ** - ** http://www.apache.org/licenses/LICENSE-2.0 + ** http://www.apache.org/licenses/LICENSE-2.0 ** - ** Unless required by applicable law or agreed to in writing, software - ** distributed under the License is distributed on an "AS IS" BASIS, - ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ** See the License for the specific language governing permissions and + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and ** limitations under the License. */ @@ -20,8 +20,6 @@ #include <EGL/egl.h> #include <EGL/eglext.h> -#include <GLES/gl.h> -#include <GLES/glext.h> #include <utils/threads.h> diff --git a/opengl/libs/EGL/egl_object.h b/opengl/libs/EGL/egl_object.h index 2a0842407..518fdec21 100644 --- a/opengl/libs/EGL/egl_object.h +++ b/opengl/libs/EGL/egl_object.h @@ -1,16 +1,16 @@ -/* +/* ** Copyright 2007, The Android Open Source Project ** - ** Licensed under the Apache License, Version 2.0 (the "License"); - ** you may not use this file except in compliance with the License. - ** You may obtain a copy of the License at + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at ** - ** http://www.apache.org/licenses/LICENSE-2.0 + ** http://www.apache.org/licenses/LICENSE-2.0 ** - ** Unless required by applicable law or agreed to in writing, software - ** distributed under the License is distributed on an "AS IS" BASIS, - ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ** See the License for the specific language governing permissions and + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and ** limitations under the License. */ @@ -24,8 +24,6 @@ #include <EGL/egl.h> #include <EGL/eglext.h> -#include <GLES/gl.h> -#include <GLES/glext.h> #include <utils/threads.h> #include <utils/String8.h> diff --git a/opengl/libs/EGL/trace.cpp b/opengl/libs/EGL/trace.cpp index a51b086e4..bac6ba8ec 100644 --- a/opengl/libs/EGL/trace.cpp +++ b/opengl/libs/EGL/trace.cpp @@ -21,8 +21,6 @@ #include <EGL/egl.h> #include <EGL/eglext.h> -#include <GLES/gl.h> -#include <GLES/glext.h> #include <cutils/log.h> @@ -39,7 +37,8 @@ namespace android { // ---------------------------------------------------------------------------- struct GLenumString { - GLenum e; + // The GL_TIMEOUT_IGNORED "enum" doesn't fit in a GLenum, so use GLuint64 + GLuint64 e; const char* s; }; |