Commit Graph

56 Commits

Author SHA1 Message Date
Jesse Hall 408e59f63a libEGL: whitelist the EGL_KHR_create_context_no_error extension
Allow EGL implementations to expose the
EGL_KHR_create_context_no_error extension if they wish.

https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_create_context_no_error.txt

Change-Id: I3290ccc2a69a1fa0b00ec3f1aa4f876906c64bfb
2015-05-12 08:42:05 -07:00
Dan Stoza a894d082cf libEGL: Add wrappers for partial update functions
This adds EGL wrapper functions for the following EGL extensions:
    EGL_EXT_buffer_age
    EGL_KHR_partial_update
    EGL_KHR_swap_buffers_with_damage

Change-Id: I407acda1e0310f7f01a5efe9c915721a941138a4
2015-04-15 13:02:27 -07:00
Jesse Hall d6061de255 opengl: Add EXT_primitive_bounding_box to registry
This extension hasn't been published yet, so it isn't in the public
registry. That will change before the next platform release to AOSP.

Bug: 15028495
Change-Id: I3f8ac50e6a7f782738518cfd4571b07f94f83c49
2014-05-21 15:24:38 -07:00
Jesse Hall 3667e33862 opengl: Update registry and headers from Khronos
gl.xml @ r26697:
https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api

GLES headers @ r26698:
https://cvs.khronos.org/svn/repos/registry/trunk/public/gles/api

Bug: 15028495
Change-Id: I57e0d8caac2bc2edb10c8252e06ffdb9a5ccf48b
2014-05-21 15:12:42 -07:00
Jesse Hall 3703f7f014 opengl: Update GLES headers and generate *.in from registry XML
Import GLES headers from Khronos SVN r26322:
https://cvs.khronos.org/svn/repos/registry/trunk/public/gles/api

There are many non-functional whitespace and parameter name changes
included here. These were introduced upstream when converting from the
old .spec registry to the new XML registry.

There are also some new extensions added. Unfortunately there isn't a
version of the XML that matches the headers the previous versions of
the *.in files were generated from, so I can't separate out the
non-functional changes from the new extensions (other than temporarily
hacking them out of the XML). See below for a list.

Finally, I had to hack the official glext.h. Khronos hasn't updated
the official GLES1 headers since switching to the XML registry, and
there is one critical difference: a "const void**" parameter in the
official header is "const void* const*" in the registry. I changed the
header to avoid build errors with code generated from the registry.

Dependencies on the *.in files required manually updating some
GLES_trace/ files as well:

- gltrace_api.{h,cpp} must be manually re-generated using
  tools/genapi.py.
- New GL prototypes must be manually added to gltrace.proto.
- gltrace.pb.{h,cpp} must be regenerated using aprotoc (see dev.make)

New GLES extensions in libs/GLES_CM/glext_api.in:
- GL_OES_byte_coordinates
- GL_EXT_map_buffer_range
- GL_APPLE_copy_texture_levels
- GL_APPLE_sync

New GLES2 extensions in libs/GLES2/gl2ext_api.in:
- GL_KHR_blend_equation_advanced
- GL_KHR_debug
- GL_OES_sample_shading
- GL_OES_texture_storage_multisample_2d_array
- GL_EXT_disjoint_timer_query
- GL_EXT_draw_buffers
- GL_EXT_draw_instanced
- GL_EXT_instanced_arrays
- GL_EXT_map_buffer_range
- GL_EXT_map_buffer_range
- GL_EXT_multiview_draw_buffers
- GL_EXT_separate_shader_objects
- GL_ANGLE_instanced_arrays
- GL_ANGLE_translated_shader_source
- GL_APPLE_copy_texture_levels
- GL_APPLE_sync
- GL_INTEL_performance_query
- GL_NV_blend_equation_advanced
- GL_NV_copy_buffer
- GL_NV_draw_instanced
- GL_NV_framebuffer_blit
- GL_NV_framebuffer_multisample
- GL_NV_instanced_arrays
- GL_NV_non_square_matrices

Bug: 15028495
Change-Id: I902517c23354e14f9c63b1584db286d682315bb5
2014-05-21 14:58:00 -07:00
Jesse Hall 2b2ac21078 Revert "Update GLES headers from Khronos SVN r26322"
This reverts commit 20670e33c7.

Change-Id: Iae3dfbaf852ff1b6906af1d5508c2baf1173b481
2014-05-20 21:59:29 +00:00
Jesse Hall 20670e33c7 Update GLES headers from Khronos SVN r26322
Public registry is:
https://cvs.khronos.org/svn/repos/registry/trunk/public/gles/api

Bug: 15028495
Change-Id: I2269a6a2486c34b6a9e378d4a25a41492d531c81
2014-05-19 12:54:04 -07:00
Jamie Gennis dbe9245e2e GLConsumer: start using EGL_ANDROID_image_crop
This change makes GLConsumer use the EGL_ANDROID_image_crop extension when
available on a device.  The crop rectangle is passed to the EGL driver when
creating EGLImages, allowing the crop to be performed by the driver rather than
using the texture transform matrix.

Bug: 10897141
Change-Id: I63e9a5d5c85067376abc420e3639154468346311
2013-10-02 17:34:35 +00:00
Mathias Agopian 2bb716871c replace eglWaitSyncANDROID by eglWaitSyncKHR
Change-Id: I22f1b3588011c88389e249f738f1e6915cc97e72
2013-03-28 14:31:09 -07:00
Mathias Agopian 12af3f6665 update EGL headers to most recent
- add ANDROID extensions missing from official headers:
    EGL_ANDROID_wait_sync
    EGL_ANDROID_presentation_time

Change-Id: I5496d0de123a6279234098c19f9a12220adec876
2013-03-28 14:17:54 -07:00
Andy McFadden 7284145d56 Add eglPresentationTimeANDROID
Added EGL extension to set a timestamp on a surface.

Also, fix JNI encoding of "long" in glgen.

Bug 8191230

Change-Id: I38b7334bade3f8ff02bffe600bb74469ef22c164
2013-03-05 10:10:59 -08:00
Jesse Hall 61d1b81213 Import OpenGL ES 3.0 headers from Khronos SVN
Add MODULE_LICENSE_MIT: The GLES headers use an MIT license or a
slight variant of it (the "SGI Free Software License B version 2.0",
http://oss.sgi.com/projects/FreeB/).

Change-Id: Ic8f946341cdd0d579f51b6f7a3ee109cd31b1691
2013-02-12 16:29:43 -08:00
Alistair Strachan 7c95911157 Import constness fix from gl3.h into gl2.h.
This change has been made in Khronos SVN for GLES2 already, however it
is mildly controversial and discussion is on-going.

This change is necessary for Android because otherwise applications
cannot include both GLES2/gl2.h and GLES3/gl3.h as the glShaderSource()
prototype mismatches. Native programs may include framework headers
(which now include GLES3 headers only) but already have included GLES2
headers, creating an incompatibility.

Change-Id: I70a4075e079ee063e76cef5a227abb0ae70aebb4
2013-02-11 16:12:49 -08:00
Andrew Hsieh 5e530e02bc am a151a19d: Merge "Fix return type of glGetAttribLocation and glGetUniformLocation"
* commit 'a151a19db2fa07295837027fb5d84c02401cc78d':
  Fix return type of glGetAttribLocation and glGetUniformLocation
2012-11-06 20:41:34 -08:00
Andrew Hsieh 300ad09822 Fix return type of glGetAttribLocation and glGetUniformLocation
from int to GLint.

See:
   http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetAttribLocation.xml
   http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetUniformLocation.xml

Change-Id: I4a9f8e9e34b8c3cca239ae84bfe8f3cdfd94802a
2012-11-06 14:39:08 -08:00
Jamie Gennis 3ff48e5e69 EGL: add the EGL_ANDROID_framebuffer_target enum
Change-Id: Id8b1b114e2a7a88956b857c63a0429e9b33fdb5c
2012-09-24 13:45:33 -07:00
Jamie Gennis 09b11432b6 EGL: expose the EXT_create_context_robustness ext
Change-Id: I1db43e96aa5e9e91a6176a4a3e5aa9d1f3ee4a7e
2012-09-24 13:45:32 -07:00
Jamie Gennis 010dd4fb89 EGL: Add the EGL_ANDROID_wait_sync extension
Change-Id: Ie9a78e07fcaf27c5c13797141ad3c692217607fb
2012-09-09 17:52:18 -07:00
Jamie Gennis 331841b96b EGL: add the native_fence_sync extension
This change adds support for the EGL_ANDROID_native_fence_sync extension to the
Android EGL layer.  It also fixes a couple minor issues with the extension spec.

Change-Id: Ic8829d21f37b701f33aa9c72c3d25e88e03fa3cd
2012-09-06 16:11:37 -07:00
Bjorn Andersson f9752cc4cf egl: Reintroduce eglGetRenderBufferANDROID
eglGetRenderBufferANDROID was removed as it had no users. This commit
reintroduces this extensions as it's used by Qualcomm graphics HAL.

Change-Id: I493306830a0d4f8722a42bcc84fb49236afdabeb
2012-08-27 18:38:35 -07:00
Jesse Hall 258385978c Hibernate the EGL implementation when idle
If the EGL implementation supports the EGL_IMG_hibernate_process
extension, use it to hibernate (and hopefully release memory or other
resources) when the process isn't actively using EGL or OpenGL ES. The
idleness heuristic used in this change is:

(a) Wake up when entering any EGL API call, and remain awake for the
    duration of the call.
(b) Do not hibernate when any window surface exists; this means the
    application is very likely in the foreground.
(c) Do not hibernate while any context is made current to a thread.
    The app may be using a client API without the EGL layer knowing,
    so it is not safe to hibernate.
(d) Only check these conditions and attempt to hibernate after a
    window surface is destroyed or a thread's context is detached. By
    not attempting to hibernate at the end of every EGL call, we avoid
    some transient wakeups/hibernate cycles when the app is mostly idle,
    or is starting to become active but hasn't created its window
    surface yet.

On a Galaxy Nexus, hibernating frees 1567 VM pages from the process.
Both hibernating and waking can take anywhere from 30ms to over 100ms
-- measurements have been very inconsistent.

Change-Id: Ib555f5d9d069aefccca06e8173a89625b5f32d7e
2012-04-09 21:36:17 -07:00
Mathias Agopian b0e76f456a remove dependency of EGL on ndk header
Change-Id: Ia6e489b5b4f028864bdf54923e81f604710dd8ad
2012-03-23 14:15:44 -07:00
Mathias Agopian 3127260614 update GLES headers and add support for corresponding new extensions.
Change-Id: I554d9659113b4721b748ee5c1a3b1ca82b11d75e
2012-01-28 20:41:35 -08:00
Mathias Agopian 4b9511c161 rework a bit how we manage EGL extensions
- don't advertise extensions that are not supported
  by any implementation

- remove EGL_ANDROID_swap_rectangle which is not
  implemented by anybody and confuses people

- add some comments about mandatory extensions

Bug: 5428001
Change-Id: Id8dc48116ac1d1eb79ec9ef55d03e29d4257c1f3
2011-11-14 19:05:45 -08:00
Jamie Gennis c42fcf05ce EGL: add the ANDROID suffix to the blob cache ext
This change adds the ANDROID suffix to the all the types and functions
defined by the EGL_ANDROID_blob_cache extension.

Change-Id: I087875b96d9a7053efb9c8d5614f9f765eed799d
2011-11-11 13:17:03 -08:00
Jamie Gennis 766010858e EGL: use an in-memory the blob cache
This change makes the makes the stub EGL_ANDROID_blob_cache callbacks
actually use a BlobCache object.

Bug: 5474671
Change-Id: I5cbaae2dea3aad2fe306c9f57029c3f215a0863a
2011-11-07 10:48:42 -08:00
Jonas Yang 1c3d72a229 Add (support for) EGL_NV_system_time extension.
Change-Id: I62bf0fcb5ccdc77c042b425a42054fb3122575b6
Signed-off-by: Mathias Agopian <mathias@google.com>
2011-09-13 16:44:22 -07:00
Jamie Gennis dc159f92fa EGL: update EGL_ANDROID_recordable extension.
This change adds an enum value and a description of the expected
implementations to the EGL_ANDROID_recordable extension specification.
It also adds the new enum value to the 'eglext.h' header.

Change-Id: Ia0de2d5613708445ff83b85a7e550f9417531ee4
2011-07-17 18:42:09 -07:00
Iliyan Malchev 697526bc9e frameworks/base: android_native_buffer_t -> ANativeWindowBuffer
Change-Id: Idc2eabaa805bb6d308ebb315872623f28d428417
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 16:40:14 -07:00
David 'Digit' Turner dfd0759ff6 Refresh EGL header to work with the NDK
This change allows to use this header with the NDK's standalone toolchain.
For the record, the NDK toolchain defines __ANDROID__ as a compiler built-in
macro, this is however not the case currently for the prebuilt binaries that
are being used by the full Android build system, which otherwise defines ANDROID.

This change allows the header to be used by all toolchains properly. Note however
that we should properly should change our toolchain and sources to provide and
rely on __ANDROID__ instead of ANDROID though.

Change-Id: Iaa1aa1146985b5f24dcf3a83d9ddb9b4b59dc328
2010-11-07 23:36:28 +01:00
Michael I. Gold 7f198b6bff surfaceflinger / GL extensions cleanup
Add correct enumerants for OES_EGL_image_external to glext.h.
SurfaceFlinger now checks for the correct extension name.

Change-Id: I2ba2728a01fa2260bd086d2df4316c68f694a9b1
2010-09-15 17:15:31 -07:00
Mathias Agopian 10cab190ba cleanup EGL a bit. remove unused extension.
Change-Id: Ia87120b076ab1bf7b28f06087878d8161fb46c88
2010-08-27 13:17:32 -07:00
Dianne Hackborn 4b5e91e482 Introduce official public NativeWindow type.
Not yet hooked up to anything in the NDK, but requires renaming
the existing android_native_window_t type everywhere.

Change-Id: Iffee6ea39c93b8b34e20fb69e4d2c7c837e5ea2e
2010-06-30 15:32:04 -07:00
Mathias Agopian 0a91775c4d Added support for the GL_TEXTURE_EXTERNAL target
This will allow us to support YUV surfaces.

Change-Id: I2d4da75f1006a5285bdc552695d4caeecccf2183
2010-06-15 17:31:17 -07:00
Mathias Agopian e81a3cb2bd update EGL headers to the latest
note that this doesn't update the EGL stubs.

Change-Id: I00274431a490249d93eb6b5ba13f274b7f2682ae
2010-06-09 18:56:05 -07:00
Mathias Agopian 05bb9c973b fix OpenGL ES extension headers from khronos
the official headers have a couple typos, which
this CL fixes.

Change-Id: I0359531a05a4a62ddbdce70c5841ec1c355feb3b
2010-06-09 18:19:11 -07:00
Mathias Agopian 8f62c3031e update the OpenGL ES headers to the latest
Change-Id: Iceef1e95504897a5e3759b0401cf7031c9e74547
2010-06-09 18:08:15 -07:00
Jack Palevich 01cc538b29 A library for encoding and decoding ETC1 textures.
The ETC1 compressed texture format is commonly
supported by OpenGL ES 2.0-capable devices.
2009-12-31 13:31:04 +08:00
Mathias Agopian 8e5fb52a1d this header file is not needed anymore 2009-07-14 14:50:44 -07:00
Mathias Agopian 8d2e83b9f4 Add eglGetRenderBufferANDROID() extension, which returns the current render buffer as an android_native_buffer_t* 2009-06-25 00:02:44 -07:00
Mathias Agopian 9f8b0c9097 Android now has its own EGL extension block (yay) 0x3140-0x314F. EGL_NATIVE_BUFFER_ANDROID now maps to 0x3140 instead of using the staging range 2009-06-23 14:05:35 -07:00
Mathias Agopian b1a39d67be Added most of the support needed for GLES 2.x 2009-05-27 20:38:06 -07:00
Mathias Agopian a3d66a834f minor modifications to the official GLES 2.x headers
- changed glTexImage2D() declaration so it matches that of GLES 1.x; otherwise we can't include both headers (!!!)
- added parameter names to the declaration of some extensions (this is needed by glapigen and glentrygen)
2009-05-27 20:32:20 -07:00
Mathias Agopian 48efd95015 add GLES 2.x headers 2009-05-27 20:31:18 -07:00
Mathias Agopian d717598616 Merge commit 'goog/master' into merge_master
Conflicts:
	opengl/libagl/Android.mk
	opengl/libs/Android.mk
	opengl/libs/egl_impl.h
2009-05-14 22:44:23 -07:00
Mathias Agopian d373c6348a remove the gl{Vertex|Color|TexCoord|Normal}PointerBounds() "extension" fro eglext.h 2009-05-08 17:18:55 -07:00
Mathias Agopian 48685c45bb only export the GL entry-points, hide everything else.
Conflicts:

	opengl/libagl/Android.mk
	opengl/libs/Android.mk
	opengl/libs/egl_impl.h
2009-05-08 15:23:38 -07:00
Mathias Agopian df3ca30bf6 created an new EGL extension called ANDROID_swap_rectangle
ANDROID_swap_rectangle allows to specify the rectangle affected by eglSwapBuffers(), anything outside of this rectangle is unchanged. in particular EGL_BUFFER_DESTROYED only applies to that rectangle. This extension as well as EGL_BUFFER_PRESERVED allow major optimizations on surfaceflinger, which can redraw only the dirty area during compositing.

However, ANDROID_swap_rectangle allows further optimizations in EGL by reducing the amount of copy-back needed. ANDROID_swap_rectangle is particularily important for software implementations.
2009-05-07 15:07:33 -07:00
Mathias Agopian 7189c0054e move opengl/include/EGL/android_natives.h to include/ui/egl/android_natives.h and don't include it from egl.h
the android_native_ types are just forward declared in egl.h
2009-05-05 18:11:11 -07:00
Mathias Agopian 21c59d0070 get rid of android_native_buffer_t::getHandle() and replace it with an handle field
this abstraction was not necessary. things are easier now.
2009-05-05 00:59:23 -07:00