History log of /frameworks/native/opengl/libs/EGL/egl.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a6bb107434ad36739c21e1f72ac8d0107808a7b9 08-Aug-2013 Mathias Agopian <mathias@google.com> make sure we have a context when creating the 1st surface

also add an option to dump the stack trace when
calling a GL function without a context.

Change-Id: I57b72bb8c322ac4253c3077bf150621bd9863b69
/frameworks/native/opengl/libs/EGL/egl.cpp
e0ea89ceef3b0fc5f3efc5d709a8156f0628c6c8 15-Jun-2013 Mathias Agopian <mathias@google.com> improve GLES jumptables

in the common case this saves one instructions per jump
(which will help with the i-cache).

this change also gets rid of the "use slow tls" option,
which was useless. So at least now architectures that don't have
assembly bindings will perform much better.

Change-Id: I31be6c06ad2136b50ef3a1ac14682d7812ad40d2
/frameworks/native/opengl/libs/EGL/egl.cpp
39c24a20bbc697630d2b92c251b70c04d6f9d00c 05-Apr-2013 Mathias Agopian <mathias@google.com> fix local include paths

Change-Id: Icb921fa796ec08612dbb2feb7e7161bcb0cf4a99
/frameworks/native/opengl/libs/EGL/egl.cpp
cab25d680e644d962041d05a319e485b96136a5d 22-Mar-2013 Mathias Agopian <mathias@google.com> improved CallStack a bit

- added a ctor that updates and dumps the stack immediately
- added a "logtag" parameter to dump()

Change-Id: Ie51c256071d282591752243bdb4f68cf9ff8829d
/frameworks/native/opengl/libs/EGL/egl.cpp
4774338bd0ad1ebe42c311fd0c72f13786b5c800 08-Feb-2013 Jesse Hall <jessehall@google.com> 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
/frameworks/native/opengl/libs/EGL/egl.cpp
a73a97728befb5ba5ad647ab3b60058c4d536ba4 18-Dec-2012 Siva Velusamy <vsiva@google.com> gltrace: Add support for tracing running applications.

Currently, to activate OpenGL tracing, an application has to be
start with --opengl-trace option (or have a debug prop set).

This CL adds support for tracing an application which may already
be running. This is implemented as follows:
- DDMS initiates a JDWP message to the VM indicating that
opengl traces be enabled.
- When that message is received, a flag is set that indicates
that tracing should be enabled.
- The trace flag is checked during every eglSwap() operation,
and if it finds that tracing should be active and it isn't,
then it starts the tracing component.

Change-Id: I3347fe89fc06c7404d7aa9360f4b21e5bf36ebcb
/frameworks/native/opengl/libs/EGL/egl.cpp
6482fa4db0a7ac99cd3503d6bf170f80b26fb695 20-Nov-2012 Siva Velusamy <vsiva@google.com> gltrace: Make sure device is debuggable.

Change-Id: Icc22ff823a2f56733b232b927dd1fa494e9e1e81
/frameworks/native/opengl/libs/EGL/egl.cpp
d991b40739fad782dbb319e9de50f3a8b70e4bc6 19-Oct-2012 Romain Guy <romainguy@google.com> am f58475b5: am 60393d45: Merge "Add runtime debugging capabilities to OpenGL" into jb-mr1-dev

* commit 'f58475b5ae4ccb3a31c05c79da8b2914c62a3510':
Add runtime debugging capabilities to OpenGL
16928bfeca8858a0acae6942fc68c14a040b92ff 19-Oct-2012 Romain Guy <romainguy@google.com> Add runtime debugging capabilities to OpenGL

The shell property debug.egl.trace can now be set to:

0
disables tracing
1
logs all GL calls
error
checks glGetError after every GL call, logs a stack trace on error
systrace
logs each GL call to systrace

Change-Id: I34a2a2d4e19c373fd9eaa1b0cd93e67c87378996
/frameworks/native/opengl/libs/EGL/egl.cpp
2e080904aba15f585fcf36df9b12ff8d00829523 10-Oct-2012 Siva Velusamy <vsiva@google.com> gltrace: Do not start gltrace from early_egl_init.

The debugging and tracing levels are initialized both during
early_egl_init and egl_display_t::initialize(). For apps this has
no effect since early_egl_init is called in the context of zygote.
This CL removes the unnecessary call from early_egl_init.

Change-Id: Ibc55c26228cd197f2e2623fbfb2d1a63d0722401
/frameworks/native/opengl/libs/EGL/egl.cpp
455e3601498096d1daa0cf0ec7c23abb28b39af3 27-Sep-2012 Mathias Agopian <mathias@google.com> assert -eng builds when calling a GL function without a context

Bug: 7241626

Change-Id: I0f1f9361e75e9186af8cff8d98a7d2224b266765
/frameworks/native/opengl/libs/EGL/egl.cpp
b29e5e8c2682ae145e8c56d9afb061f8da7f854c 05-Apr-2012 Jesse Hall <jessehall@google.com> Increment/decrement a counter around EGL calls

This is in preparation for a change that will hibernate the underlying
EGL when idle. Instead of a bare egl_display_t*, get_display() now
returns a egl_display_ptr, which acts like a smart pointer. The
"wakecount" counter managed by the smart pointer isn't used for
anything in this change. It will be used to make sure we don't
hibernate when any thread is in an EGL call, without having to hold a
mutex for the duration of the call.

Change-Id: Iee52f3549a51162efc3800e1195d3f76bba2f2ce
/frameworks/native/opengl/libs/EGL/egl.cpp
b13c78f8520ef5a96effdee977bbacb881236c66 09-Mar-2012 Siva Velusamy <vsiva@google.com> gltrace: Expose a function to set OpenGL trace level.

This patch adds a function setGlDebugLevel() to libEGL to enable
GL tracing. This will be used by the Java layer to add an option
to "am start" that can enable tracing for a particular application.

Change-Id: Ie1dbdd550f502df8633553595cb33ee9d9ae44e1
/frameworks/native/opengl/libs/EGL/egl.cpp
7c0441ac271f4e00a2d63eb3048c037ebffa90b9 15-Feb-2012 Mathias Agopian <mathias@google.com> Don't wrap EGLImageKHR and EGLSyncKHR anymore

this simplify our EGL wrapper implementation a lot.
This wrapping is no longer needed now that we can only
support a single underlaying EGL implementation.

Change-Id: I8213df7ac69daac447f1fe6e37044b78aac4e9a9
/frameworks/native/opengl/libs/EGL/egl.cpp
7773c435bc5da8217433e1b242d3a6712a17b5f7 14-Feb-2012 Mathias Agopian <mathias@google.com> EGLConfig is now not remaped to an internal EGLConfig

this is possible now that we support only a single
EGL implementation. this allows a large code simplification.

Change-Id: I7a6b9db4c5d60f4407c6061e7a68729af63d5242
/frameworks/native/opengl/libs/EGL/egl.cpp
ada798b7ca7cabc255aa159964b64975e7fdb2df 14-Feb-2012 Mathias Agopian <mathias@google.com> remove multiplexing of multiple EGL implementation

from now on, the system can only have one EGL
implementation. this means the software and h/w renderer
cannot be used at the same time on a device. Of course, the
h/w renderer is always prefered; in its absence we
default to the software renderer.

Change-Id: Ib579f58055dd0ce4c4a99144131efa11c16ca3d3
/frameworks/native/opengl/libs/EGL/egl.cpp
48d438d05f14c2f4bd83ae89f520368cd49122df 29-Jan-2012 Mathias Agopian <mathias@google.com> add support for GL_EXT_debug_marker

This extension is always added to the GL_EXTENSIONS
extension string for the current GL context, regardless
of if it's supported by the h/w driver.

The extension itself will be handled by GLES_trace (eventually),
when GLES_trace is not enabled, it'll result to a no-op.

If the h/w implementation has this extension, we'll call that version
instead of our dummy version.

Change-Id: Ie5dd3387c4d45cd5ed5f03b73bda6045620a96bc
/frameworks/native/opengl/libs/EGL/egl.cpp
e6f43ddce78d6846af12550ff9193c5c6fe5844b 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
/frameworks/native/opengl/libs/EGL/egl.cpp
93a826f78f6313db791e6fc880439189897651b3 14-Dec-2011 Siva Velusamy <vsiva@google.com> gltrace: transport buffering and context management

This patch adds two improvements:
1. Protobuf messages are buffered and sent in chunks.
2. Multiple EGL contexts are handled properly: Corresponding
to each EGLContext, a GLTraceContext with a unique ID is created.
On eglMakeCurrent, the appropriate GLTraceContext is set and is
used while tracing subsequent GL Calls in that thread.

Change-Id: I34076376d3e5af205c87c7396ea47659844abd6e
/frameworks/native/opengl/libs/EGL/egl.cpp
9d4536835248525f32f1504a3d28d5bbfa0a2910 20-Dec-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
/frameworks/native/opengl/libs/EGL/egl.cpp
0469dd6d55fa331bfd7de9431da98b6340d82271 01-Dec-2011 Siva Velusamy <vsiva@google.com> glestrace: Framework for GLES tracing library

This patch provides a framework for tracing GLES 1.0 and 2.0
functions. It is missing a lot of features, but here are the
things it accomplishes:

- Stop building the glesv2dbg library, and build the
glestrace library instead.
- Replace the hooks for glesv2dbg with the ones for glestrace.
- Add the basics for the trace library. Currently, this
traces all GL functions, but not all required data is
sent for all the functions. As a result, it will not
be possible to reconstruct the entire GL state on the
host side.

The files gltrace.pb.* and gltrace_api.* are both generated
using the tools/genapi.py script.

Change-Id: Id60a468f7278657f008bc6ea1df01f9bdfecfdd3
/frameworks/native/opengl/libs/EGL/egl.cpp
f0480de37492597a5c5cf1e6f8346f1467e3a552 14-Nov-2011 Mathias Agopian <mathias@google.com> fix crash when validating an invalid EGL objects

the code that validated EGL objects dereferenced the object
to access its EGLDisplay -- needed for validation (!).
This was wrong for two reasons, first we dereferenced the object
before validating it (potentially leading to a crash), secondly
we didn't validate that the object existed in the right EGLDisplay.

We now use the EGLDisplay passed by the user API.

Change-Id: I66f9e851d4f8507892a6b1fee3065f124c4e7138
/frameworks/native/opengl/libs/EGL/egl.cpp
ecfe091af3e3e5d7165fe64a5f9c84c4576a6c06 07-Sep-2011 Mathias Agopian <mathias@google.com> add an option to EGL to dump stack traces on errors

enable by setting debug.egl.callstack to 1

Change-Id: I7fad9ce71b4c4c5ece97d4f9d139348eab742a3c
/frameworks/native/opengl/libs/EGL/egl.cpp
ccfa5c3364a88b0acdbe555b210bd2bc9feb6285 01-Sep-2011 Mathias Agopian <mathias@google.com> this should fix the GL debugger

we were checking against to the wrong variable

Change-Id: Iff3f5ab2d6ba5ac0d3d8161011b38e673ee7e67b
/frameworks/native/opengl/libs/EGL/egl.cpp
e03de9379410fd9947189f0f14e3ec457df2ebfe 12-Jul-2011 Romain Guy <romainguy@google.com> Always make GL calls with a valid EGL context.
Bug #5010760

Change-Id: If7500ef69683948e727df1406f458f18b11259d1
/frameworks/native/opengl/libs/EGL/egl.cpp
1cadb25da1ed875bdd078270e642966724a0c39a 24-May-2011 Mathias Agopian <mathias@google.com> fix x86 build

Change-Id: I03cfbfeaeb8b13842248856b14b4a23711036e10
/frameworks/native/opengl/libs/EGL/egl.cpp
5b287a6ea8dfac7ab3e03ae1e98f9e2214cbae09 17-May-2011 Mathias Agopian <mathias@google.com> eglTerminate() now actually frees up all active egl objects

as specified by the EGL specification, terminated objects's
handles become invalid, the objects themselves are destroyed
when they're not current to some thread.

Change-Id: Id3a4a5736a5bbc3926a9ae8385d43772edb88eeb
/frameworks/native/opengl/libs/EGL/egl.cpp
518ec112f468eb67bf681b3eec896d7bfb4ff98d 14-May-2011 Mathias Agopian <mathias@google.com> refactor EGL source code

no changes is functionality. split various objects into their own files.
make egl_display objec's lock internal.
/frameworks/native/opengl/libs/EGL/egl.cpp
1b528fb9d818044973abf656c9d2d3c1192bcfdc 26-Apr-2011 Jamie Gennis <jgennis@google.com> EGL: Allow creating a SurfaceTexture EGLSurface.

This change removes the check that disallowed the creation of an
EGLSurface that would send frames to a SurfaceTexture.

Change-Id: I44c6d5df503cc676a88144d72d39b414692ce4c9
/frameworks/native/opengl/libs/EGL/egl.cpp
499c6f02e696622a532a504be9706896aea5a304 09-Apr-2011 David Li <davidxli@google.com> GLES2Dbg: use dump.gles2dbg file when fails to create socket

setprop debug.egl.debug_forceUseFile 1: always use file
setprop debug.egl.debug_maxFileSize <int MB>: exit when reached
setprop debug.egl.debug_filePath <path>: may need to make the file
writable first.
setprop debug.egl.debug_port <unsigned short>
setprop debug.egl.debug_proc <proc cmdline>: to match debuggee process

Change-Id: I34ca1f3092f3abf17e2ded9d1689d0cdef6e07e8
Signed-off-by: David Li <davidxli@google.com>
/frameworks/native/opengl/libs/EGL/egl.cpp
864f839e969ba3417d82ab3ff7906b2f69afa900 28-Mar-2011 David Li <davidxli@google.com> GLES2Dbg: change GLES2_dbg to shared library

Change-Id: I493e9bff431bd939f4e80e1e9c614dd557307fa2
Signed-off-by: David Li <davidxli@google.com>
/frameworks/native/opengl/libs/EGL/egl.cpp
7fecf8c1ff04b85de0656d823224702ec5175344 01-Apr-2011 Eric Hassold <hassold@google.com> Initialize reference counter for egl_display_t

Add missing member initialization for reference counter, used to determine
if a context is ready.

Change-Id: I45f81177ac2851129681f827afe015b60b3cd73c
/frameworks/native/opengl/libs/EGL/egl.cpp
11c01568c31157bb2486e73efd3249a26dcaecb5 25-Mar-2011 Eric Hassold <hassold@google.com> Make objects collection a member of egl_display object

Move EGL objects (contexts, surfaces, ...) collection from global
static into EGL display object. Since EGL implementation currently
supports only one display, this doesn't change current logic. This
aims at preparing for next coming changes in eglTerminate() to
support per-display cleanup.

Bug: 4152714
Change-Id: I5e424781b89c3c275f9922f943463d5f6b1f6bc6
/frameworks/native/opengl/libs/EGL/egl.cpp
3ede7c133af1fc9713d7f2aedd785ce6bad780e8 23-Mar-2011 Eric Hassold <hassold@google.com> Check for initialized EGLDisplay when required by specification

Check for initialized display, and set EGL error to EGL_NOT_INITIALIZED
whenever it isn't, for all EGL functions taking an EGLDisplay as argument
and requiring it to have been initialized.

Bug: 3366011
Change-Id: Ib1d8a3a207257995518f4430fe97f8c406c7fc13
/frameworks/native/opengl/libs/EGL/egl.cpp
5a0d29009c5e66dde652eb5c7fd1812bcf97547e 17-Mar-2011 David Li <davidxli@google.com> Merge "GLES2Debugger: Make command exchange async to improve performance."
7d7723d330f544d1e3882b2a360a6e8b6b70e02a 17-Mar-2011 Mathias Agopian <mathias@google.com> am 9405d987: am a05a8ac5: am af831a7b: Merge "fix [4107131] nvidia driver call takes a very long time" into honeycomb-mr1

* commit '9405d98705db1c8102b77ef960f344ac416d165c':
fix [4107131] nvidia driver call takes a very long time
36bdf14a75a7c5e50f62d8f9e1c1be0c8e8a41be 16-Mar-2011 Mathias Agopian <mathias@google.com> fix [4107131] nvidia driver call takes a very long time

We were leaking all EGLSyncKHR objects, over time the list
would grow and become very slow to operate on.

Bug: 4107131
Change-Id: I6c82daf49fe3189d04550781d64d57c30c95f552
/frameworks/native/opengl/libs/EGL/egl.cpp
9db01a7c1c64d2ce00fdbeb0730278998b97183f 15-Mar-2011 Jamie Gennis <jgennis@google.com> am 0ea44ac0: am 00f47af8: Merge "SurfaceTexture: disallow unsupported uses." into honeycomb-mr1

* commit '0ea44ac0deb5cc95d60dd512c3a8f6a1bb69f5d1':
SurfaceTexture: disallow unsupported uses.
5c0c93a8c49b4053744efb8953b915fa7f0923a5 14-Mar-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: disallow unsupported uses.

This change makes the ANativeWindow_lock NDK function error out if it is
passed an ANativeWindow with a concrete type that is not Surface. It
also makes eglCreateWindowSurface fail if it is passed a
SurfaceTextureClient as its 'window' argument.

Bug: 4087277
Change-Id: Ie68c50c52d88f72d8a387f6c094908044c83a88c
/frameworks/native/opengl/libs/EGL/egl.cpp
85f33a7168c5563aa7765b91d5d045fe62bcfcd8 11-Mar-2011 David Li <davidxli@google.com> GLES2Debugger: Make command exchange async to improve performance.

In message loop, use select to check for available commands from client,
rather than always expecting commands in eglSwapBuffers.

Change-Id: Ifc34dd77c2528c8b9c71f594e3eda4f93400cd2b
Signed-off-by: David Li <davidxli@google.com>
/frameworks/native/opengl/libs/EGL/egl.cpp
65948aa0466e3e833c5a4e4feec78c787d8769a7 11-Mar-2011 David Li <davidxli@google.com> GLES2Debugger: Added DbgContext and vertex data capturing.

Send VBO related commands to client, which tracks the state.
Maintain index buffer content and vertex attrib pointer/buffer state on server.
During glDrawArrays/Elements, send user memory data to client.

Change-Id: Ia920e90479329b301ae4b5735e833eeb20293c94
Signed-off-by: David Li <davidxli@google.com>
/frameworks/native/opengl/libs/EGL/egl.cpp
b33d5cff62c912fb0312daca083002558fb4a26b 05-Mar-2011 David Li <davidxli@google.com> Added screenshot after glDraw* option to GLES2 Debugger

Also added timing mode option using utils/Timers.h.
Factored out common code to reduce size.
Improved Protobuf message.
Uploads data from glBufferData and glBufferSubData.

Change-Id: Iaae5e706235d942df81c7eada7223fb0b0583911
Signed-off-by: David Li <davidxli@google.com>
/frameworks/native/opengl/libs/EGL/egl.cpp
2f5a6557ef6a7b9fd33077cfd8a037904d41e3bd 02-Mar-2011 David Li <davidxli@google.com> Initial commit of GLESv2 debugger server

Use debug.egl.debug_proc property to match process cmdline.
Binds to TCP:5039 and waits for client connection.
Sends function call parameters, textures and shaders using Protobuf.
Java Eclipse client plug-in is next.

Change-Id: I183b755263663f87e86dde1ad12f527d0445fd57
Signed-off-by: David Li <davidxli@google.com>
/frameworks/native/opengl/libs/EGL/egl.cpp
af1cf07134dccc884c654da0e713c9213d7be3f4 16-Feb-2011 Kenny Root <kroot@google.com> Clean up use of HAVE_ANDROID_OS

HAVE_ANDROID_OS was defined as "1" for targets, but never defined as "0"
for non-targets. Changing them to #ifdef should be safe and matches
all the other uses of HAVE_ANDROID_OS throughout the system.

Change-Id: I82257325a8ae5e4e4371ddfc4dbf51cea8ea0abb
/frameworks/native/opengl/libs/EGL/egl.cpp
f1cde8e0ed019791641bd07c5c1f965b0f8cf7c5 31-Jan-2011 Jamie Gennis <jgennis@google.com> Clear all EGL errors when entering EGL funcs.

This changes the clearError function in the EGL wrapper layer to simply
call eglGetError(). That should clear any pending errors from all the
underlying EGL implementations, which is needed to correctly report the
error for the most recently called EGL function.

Change-Id: Iad19c69f0c5305e873f3c2f96d353280d31f7b61
/frameworks/native/opengl/libs/EGL/egl.cpp
4aea6bff1409590559341fe41b68360b8da64e26 22-Jan-2011 Michael I. Gold <gold@nvidia.com> egl: clear error on function entry

Clear the current thread error state on entry to API functions as
mandated by the EGL 1.4 specification, section 3.1. glGetError
returns additional information about the "most recent EGL function".

Change-Id: Ic24c64b39294ffc1a4e43fa72663e076b9d7decf
/frameworks/native/opengl/libs/EGL/egl.cpp
609bb4dbf04d78c9f7b4cc5988aafda020c38a61 04-Jan-2011 Michael I. Gold <gold@nvidia.com> egl: fix GetProcAddress for EGLimage extensions

Return wrappers from GetProcAddress for glEGLImageTargetTexture2DOES
and glEGLImageTargetRenderbufferStorageOES which unwrap the EGLimage
handle before calling through to the implementation.

Change-Id: I2f5b180ab3ccdb28a4f510a2bd8c2eee941a84df
/frameworks/native/opengl/libs/EGL/egl.cpp
ca41e362662a50383679b18d9832f6120dc721d9 13-Jan-2011 Michael I. Gold <gold@nvidia.com> egl: expose EGLimage extensions

Add EGL_KHR_gl_texture_cubemap_image and EGL_KHR_gl_renderbuffer_image
to the static EGL extension string since these require no new APIs
beyond what is already required.

Change-Id: I2d1fde86b19bb9eee46b3b977f51784a17cfcc3c
/frameworks/native/opengl/libs/EGL/egl.cpp
0c3ce2a3650e5a8a005179162c87af639eef60cf 23-Dec-2010 Michael I. Gold <gold@nvidia.com> egl: fixes for object refcounts

eglMakeCurrent() would only deref the previous surfaces if the old and
new contexts were the same. eglTerminate() should not touch TLS.
eglReleaseThread() needs to unbind the current context.

Change-Id: I213b8be77b1a23b5a8a6afaac60643662c8aa010
/frameworks/native/opengl/libs/EGL/egl.cpp
2fa3af5b43ed6c4288fcc25ac05efbad17ef8bf2 09-Dec-2010 Mathias Agopian <mathias@google.com> am 054ae782: am e1752f41: Merge "fix [3258603] \'Quadrant\' benchmark crashes inside eglQueryContext on GB/Crespo" into gingerbread

* commit '054ae78245fe9b4c14bbc372ae77cd0a977ded73':
fix [3258603] 'Quadrant' benchmark crashes inside eglQueryContext on GB/Crespo
c3ce8809728cad1724458006a38892d2fa0d0e4d 09-Dec-2010 Mathias Agopian <mathias@google.com> fix [3258603] 'Quadrant' benchmark crashes inside eglQueryContext on GB/Crespo

eglQueryContext(..., EGL_CONFIG_ID, ...) is dereferencing an uninitialized pointer
due to a typo.

Change-Id: I100addf3150f19cb6dfbce9987fb5239dd240878
/frameworks/native/opengl/libs/EGL/egl.cpp
b0c48b89934ec6fdef36ca438ab7ffffb5b2e014 07-Dec-2010 Mathias Agopian <mathias@google.com> am 0484a673: am daef0a04: Merge "[3229973, 3247470, ...] set EGLNativeWindowSurface\'s format in EGL" into gingerbread

* commit '0484a673c5839d2be9e615e52c6a45febdf1127b':
[3229973, 3247470, ...] set EGLNativeWindowSurface's format in EGL
644bb2a29e5c725a92f8744b6065a5ca7d7dc31f 25-Nov-2010 Mathias Agopian <mathias@google.com> [3229973, 3247470, ...] set EGLNativeWindowSurface's format in EGL

(there are multiple bugs this should fix)

we now use the EGL_NATIVE_VISUAL_ID of a config to set
the ANativeWindow's format from eglCreateWindowSurface(),
this guarantees that the surface's format will match
whatever EGLConfig the user chose.

this should fix all current and future config/surface format
mismatch and allow users to easily select 32-bits surfaces.

Change-Id: I3835d0eb70c75eeecded3c3509a0a8207554c98b
/frameworks/native/opengl/libs/EGL/egl.cpp
744026fed6be5a95927de2db1a9c76a60473bd12 09-Nov-2010 Mathias Agopian <mathias@google.com> DO NOT MERGE. workaround [3177481] eglGetProcAddress() returns the wrong pointer for some GL extensions

We just make sure eglGetProcAddress() will return NULL for
glEGLImageTargetTexture2DOES
glEGLImageTargetRenderbufferStorageOES

which is better than returning the address of the wrong implementation.

the correct fix is more involved.

Change-Id: I585a1f40e564f862e5dd382224609ccd069cd3b5
/frameworks/native/opengl/libs/EGL/egl.cpp
a2dd6cf59962e3a21a47df29b2f243e904839ba7 27-Oct-2010 Jack Palevich <jackpal@google.com> OpenGL tracing.

Enable with:

adb shell setprop debug.egl.trace 1

Change-Id: Icfbc795f5260141510975228e72234e9aab56a85
/frameworks/native/opengl/libs/EGL/egl.cpp
30faafb7d3544ab013958fbc920c1bc4d3f05472 24-Sep-2010 Mathias Agopian <mathias@google.com> am 4eb1ad5e: am 524a6d8e: Merge "better fix for [3028370] GL get error should return a valid error if no context is bound." into gingerbread

Merge commit '4eb1ad5e98c7b36f7ac4ec8c3270f9763afd107e'

* commit '4eb1ad5e98c7b36f7ac4ec8c3270f9763afd107e':
better fix for [3028370] GL get error should return a valid error if no context is bound.
6f0871222f04dfeb479d37fe9753d491e3150e42 24-Sep-2010 Mathias Agopian <mathias@google.com> better fix for [3028370] GL get error should return a valid error if no context is bound.

it turns out that we cannot return INVALID_OPERATION from glGetError() because the
GL spec says that it must be called in a loop until it returns GL_NO_ERROR.

now, we always return 0 from GL functions called from a thread with no
context bound. This means that glGetError() will return NO_ERROR in this case,
which is better than returning a random value (which could trap the app in a loop).

if this happens in the main thread of a process, we LOG an error message once.

Change-Id: Id59620e675a890286ef62a257c02b06e0fdcaf69
/frameworks/native/opengl/libs/EGL/egl.cpp
aa22d205549f5c9604f5d66b5368c53b484c3638 23-Sep-2010 Mathias Agopian <mathias@google.com> am 9c4d7d67: am 5c6c5c7a: fix [3028370] GL get error should return a valid error if no context is bound.

Merge commit '9c4d7d677097981a349c718902e29050dad3d59f'

* commit '9c4d7d677097981a349c718902e29050dad3d59f':
fix [3028370] GL get error should return a valid error if no context is bound.
05c53113e0c73c7cab61edf53524c61c20a547c2 23-Sep-2010 Mathias Agopian <mathias@google.com> fix [3028370] GL get error should return a valid error if no context is bound.

glGetError() will now always return GL_INVALID_OPERATION if called from a thread
with no GL context bound.

Change-Id: I28ba458871db051bb4f5a26668a1fa123526869c
/frameworks/native/opengl/libs/EGL/egl.cpp
cd2c51cf451bb4ff8cde6724b10e420b42ca4d90 22-Sep-2010 Mathias Agopian <mathias@google.com> am d01ce192: am 9d5fac51: Merge "fix small bug in EGL error management" into gingerbread

Merge commit 'd01ce1924a51539c4d47ef1f55913bdf1a018124'

* commit 'd01ce1924a51539c4d47ef1f55913bdf1a018124':
fix small bug in EGL error management
a93b957e8e3170b0cc7b7fb5d847f6e98fb1e87b 22-Sep-2010 Mathias Agopian <mathias@google.com> fix typo EGL_NO_IMAGE_KHR -> EGL_NO_SYNC_KHR

Change-Id: I38c87803e32030918f2deb06381eabce0faa870c
/frameworks/native/opengl/libs/EGL/egl.cpp
02dafb5068be31cc45af897a8bd1cae8f4724401 22-Sep-2010 Mathias Agopian <mathias@google.com> fix small bug in EGL error management

make sure to clear our EGL implementation's error when returning
an error from an underlying implementation

Change-Id: Ibce4726cef1f900e4c7f16002345d7a07f8cdf41
/frameworks/native/opengl/libs/EGL/egl.cpp
c291f585855f0e2569bde9dd47b62e46c06c45f3 28-Aug-2010 Mathias Agopian <mathias@google.com> Add support for KHR_fence_sync

Change-Id: Ie2771b5869c9c8dcf5ecf9318e2ee6d4d1cd5cc9
/frameworks/native/opengl/libs/EGL/egl.cpp
acd8fd04934c3d5fb9853fd250b6a7f2ab347276 09-Sep-2010 Mathias Agopian <mathias@google.com> am a9ff29b5: am 6808e6a8: Merge "Fix a few typos in EGL wrapper" into gingerbread

Merge commit 'a9ff29b59cf33e552285a0bff3caf7a44f93f1c0'

* commit 'a9ff29b59cf33e552285a0bff3caf7a44f93f1c0':
Fix a few typos in EGL wrapper
77fbf8ddd9ecdde8272de845db29c34a6f1ff55e 09-Sep-2010 Mathias Agopian <mathias@google.com> Fix a few typos in EGL wrapper

Change-Id: I3b815ca6ec334ca12088f9721eece33df42b2e46
/frameworks/native/opengl/libs/EGL/egl.cpp
8e4b5a3e6af0dcb636b6f7baa9e908681776fa36 28-Aug-2010 Mathias Agopian <mathias@google.com> Add KHR_gl_texture_2D_image extension string.
/frameworks/native/opengl/libs/EGL/egl.cpp
27e2fac3370d2de56c05b9ec838ceff9a10b137c 27-Aug-2010 Mathias Agopian <mathias@google.com> cleanup EGL a bit. remove unused extension.

Change-Id: I7758bc7d6dc2e70fc3590fe939ebf71fbcde7059
/frameworks/native/opengl/libs/EGL/egl.cpp
10cab190ba3bdad058cbb674f956e7b251bf74da 27-Aug-2010 Mathias Agopian <mathias@google.com> cleanup EGL a bit. remove unused extension.

Change-Id: Ia87120b076ab1bf7b28f06087878d8161fb46c88
/frameworks/native/opengl/libs/EGL/egl.cpp
4a88b522359c080d4da5ac3f016b3272021655c9 13-Aug-2010 Mathias Agopian <mathias@google.com> fix [2912927] Can't get NV_draw_path extension to work

there was a problem with eglGetProcAddress() which would only work with
GLES 1.x contexts.

Change-Id: I4747671cbf7ed469bb471a377f1d6f36550d24df
/frameworks/native/opengl/libs/EGL/egl.cpp
24035338ed6329e4d85fb00cf99a91e2cdd55ba5 03-Aug-2010 Mathias Agopian <mathias@google.com> fix [2421247] implement eglGetProcAddress(), needed in the ndk

Change-Id: I5027a27b43c0dd449a404024087853ca05bb8e4e
/frameworks/native/opengl/libs/EGL/egl.cpp
cee79391c8c4e4111dd2f5074fa84d47b2a8f153 27-Jul-2010 Mathias Agopian <mathias@google.com> fix [2870926] Issue 9802: EGL wrapper has not been implemented correctly for eglQuerySurface().

rework how our EGL wrapper manages EGLConfig:

- we now store the EGLConfig with the EGLSurface and EGLContext
so that we can have easy access to it from eglQueryContext
and eglQuerySurface.

- EGLConfig now are an index into a sorted table of egl_config_t,
we use a binary search to retrieve our EGLConfig (the index) from
the implementation's EGLConfig.

- egl_config_t keeps track of the implementation's index,
EGLConfig and CONFIG_ID as well as our CONFIG_ID.

In many ways, this implementation is simpler and more robust, as it doesn't
assume anything about the number of implementations nor what EGLConfig is
made of (the previous code assumed EGLConfig didn't usem more than 24-bits).

Change-Id: Id5abe923aacb6e1fd2b63bd8c15d7b04ae824922
/frameworks/native/opengl/libs/EGL/egl.cpp
4c39f8f9e2df75a5b53b3ccae712a8946195a8a3 02-Jul-2010 Jamie Gennis <jgennis@google.com> Fix a bug that prevented the creation of EGL shared contexts.

Change-Id: I6b0ec5ef86abdd4e9083067ba297107cfb094df3
/frameworks/native/opengl/libs/EGL/egl.cpp
04aed2149d95f04602127eef4d5b6d7d48684359 17-May-2010 Mathias Agopian <mathias@google.com> fix a crasher in our EGL wrapper when attrib_list is NULL in eglChooseConfig

the EGL specification states that this should be treated as though it was
an empty list terminated with EGL_NONE.

Change-Id: I294104370a86b5e5c34c7bcf15c5459eab464631
/frameworks/native/opengl/libs/EGL/egl.cpp
bf41b11ef889b69a5ef75a2e223c95c5cfc5731c 09-Apr-2010 Mathias Agopian <mathias@google.com> small cleanup. gEGLImpl should have been static

also added a ctor to initialized it in case we use it ont he stack
one day.

Change-Id: I2736b9bce3d8ba3b74fd029de4c18cca2cdbbf60
/frameworks/native/opengl/libs/EGL/egl.cpp
81cd08448586d73e1ea602f4c83a2203483ae735 16-Mar-2010 Jack Palevich <jackpal@google.com> Implement eglInitialize / eglTerminate reference counting

Previously we imlpemented the standard semantics for
eglInitialize / eglTerminate, which are that
eglInitialize may be called any number of times,
but the first call to eglTerminate will terminate
the display.

Now we follow reference-countins semantics, which
means that eglTerminate will only terminate the
display when the reference count returns to zero.

This change allows EGL to be used by multiple
independently written modules in the same process.

(Otherwise there is no way for the independent
modules to coordinate their use of the display.)
/frameworks/native/opengl/libs/EGL/egl.cpp
75bc27803efd96d15f48ef36429b27ab31182b67 06-Feb-2010 Mathias Agopian <mathias@google.com> fix [2189862] Race condition in eglIntialize and eglDestroy

there is now a lock protext a perticular display. it's held during
initialization and destruction.
/frameworks/native/opengl/libs/EGL/egl.cpp
8063c3ab04c922ef7c9bc3984a75503598001fd9 25-Jan-2010 Mathias Agopian <mathias@google.com> fix [2303866] eglMakeCurrent doesn't return all error messages described in the spec
/frameworks/native/opengl/libs/EGL/egl.cpp
863e5fdde858d732ac76320369b6304599f23b4c 30-Oct-2009 Mathias Agopian <mathias@google.com> fix[2222341] Soft reset while going back from camcorder settings

add a way to convert a mapped "pushbuffer" buffer to a gralloc handle
which then can be safely used by surfaceflinger, without including
gralloc_priv.h
/frameworks/native/opengl/libs/EGL/egl.cpp
df2d92940550bc68c3c237937bce7ac16d9fa91b 29-Oct-2009 Mathias Agopian <mathias@google.com> return proper error code from eglCreateImageKHR
/frameworks/native/opengl/libs/EGL/egl.cpp
618fa10949c42eb83fa5fe105fe542bcff833dda 14-Oct-2009 Mathias Agopian <mathias@google.com> fix [2187212] add support for GLESv2 dispatch based on TLS

Instead of using a different function pointer table for ES 1.x and ES 2.x,
we use a single one that is the union (sort|uniq) of both tables. Two
instances of this table are initialized with pointers to GL ES 1.x and GL ES 2.x
entry-points.
When a context is created, we store its version number and when it is bound to a
thread we set the approruiate table based on the stored version.

This introduce no penalty while dispatching gl calls to the right API version.

[Pending Dr No approval for MR1]
/frameworks/native/opengl/libs/EGL/egl.cpp
a69e0ed4a38ded9778d37da453899d527c4396b9 25-Aug-2009 Mathias Agopian <mathias@google.com> fix a bug recently introduced where EGL couldn't be initialized again after it had been terminated once
/frameworks/native/opengl/libs/EGL/egl.cpp
9429e9c8ad8ae41104c693235a9376b3086da2e9 21-Aug-2009 Mathias Agopian <mathias@google.com> first step for fixing [2066786] EGL object lifetime management doesn't respect the EGL spec

this change fixes the lifetime mgt of EGLSurface, EGLContext and EGLImageKHR in the EGL wrapper.
EGLDisplay is still somewhat bogus and libagl's EGL is still incorrect.

The idea of the change is that EGL objects are put in a list when created and removed when destroyed.
Before each use, we first verify if the object is in the list and if so a reference is taken and kept
for the scope of the whole EGL API being called, if not, an error is returned.

Upon object destruction, the object is simply marked as "terminated" (this is not protected by a lock
because it doesn't really matter). This flag is only used to deny access to the object by other APIs
while it's still valid (for instance current or being used by another function in another thread).
A reference is also removed and the object can then actually be destroyed when going out of scope.
/frameworks/native/opengl/libs/EGL/egl.cpp
923c661a86c9e0737b3f16ceffd77e71e023ca54 18-Aug-2009 Mathias Agopian <mathias@google.com> fix bug [2021677] egl driver unloaded after eglTerminate() is called

refactored the code so that:
- EGL APIs that can be called before or after eglInitialize() will work by loading the drivers first
- make eglGetDisplay() a lot more efficient
- make sure that EGL drivers are loaded in a thread-safe way
- don't unload the drivers upon calling eglTerminate(), they're now never unloaded, since there is no safe way to do it (some thread could be running)
- updated our EGL version to 1.4
- return better error codes if errors happen during initialization
/frameworks/native/opengl/libs/EGL/egl.cpp
24e5f5290195e1c02c18730d0639efda65d64914 13-Aug-2009 Mathias Agopian <mathias@google.com> Better error handling in EGL extensions
/frameworks/native/opengl/libs/EGL/egl.cpp
d274eae545ded690846416d6bfe987d8405eeaba 01-Aug-2009 Mathias Agopian <mathias@google.com> log opengl-call-with-no-context only once per thread, instead of for each function call
/frameworks/native/opengl/libs/EGL/egl.cpp
2521f47c4d45a4d02c3a9f608c73de744c8b44f6 10-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am 46e28db8: Merge change 6713 into donut

Merge commit '46e28db8818332e3cda4cc410cc89a1ed7ce4db6'

* commit '46e28db8818332e3cda4cc410cc89a1ed7ce4db6':
fix for [1969185] valgrind errors in new gl stuff
dacd7a33c458240355c4b22dcc82809241447ab8 10-Jul-2009 Mathias Agopian <mathias@google.com> fix for [1969185] valgrind errors in new gl stuff
/frameworks/native/opengl/libs/EGL/egl.cpp
8d2e83b9f44c7f2207a312fcfda8eb3a4c26745f 25-Jun-2009 Mathias Agopian <mathias@google.com> Add eglGetRenderBufferANDROID() extension, which returns the current render buffer as an android_native_buffer_t*
/frameworks/native/opengl/libs/EGL/egl.cpp
af74213546acc887b2b9e93459124cefd7f5e335 25-Jun-2009 Mathias Agopian <mathias@google.com> fix [1942438] eglGetCurrentSurface() returns bogus value
/frameworks/native/opengl/libs/EGL/egl.cpp
f51f9c8af3a9974fa71be73a905aec70672aa0cb 25-Jun-2009 Mathias Agopian <mathias@google.com> fix [1942438] eglGetCurrentSurface() returns bogus value
/frameworks/native/opengl/libs/EGL/egl.cpp
de58697644a52a614ad9498aa087e95d4a223673 29-May-2009 Mathias Agopian <mathias@google.com> implement a real loader for EGL drivers

we now look for a config file in /system/lib/egl/egl.cfg that describes the association of a display to a driver.
these drivers are named: /system/lib/egl/lib{[EGL|GLESv1_CM|GLESv2] | GLES}_$TAG.so
/frameworks/native/opengl/libs/EGL/egl.cpp
b1a39d67be99fe6c4545b25e10ac82a5dd1df634 28-May-2009 Mathias Agopian <mathias@google.com> Added most of the support needed for GLES 2.x
/frameworks/native/opengl/libs/EGL/egl.cpp
d8fb7b586f3cfac42694208547b58438d7f3b3ed 18-May-2009 Mathias Agopian <mathias@google.com> remove libEGL and libGLESv1_CM dependencies on libutils and libui
/frameworks/native/opengl/libs/EGL/egl.cpp
d717598616910b5454b56429dec3bfad2757bd52 15-May-2009 Mathias Agopian <mathias@google.com> Merge commit 'goog/master' into merge_master

Conflicts:
opengl/libagl/Android.mk
opengl/libs/Android.mk
opengl/libs/egl_impl.h
eccc8cfb2fc83e7f924016ef31e3a4a12e347e99 13-May-2009 Mathias Agopian <mathias@google.com> should help fix the Simulator build.
/frameworks/native/opengl/libs/EGL/egl.cpp
e6bf8b32b616450f80b64d226ea673f4a2e0bf8d 07-May-2009 Mathias Agopian <mathias@google.com> fix EGL extension string names
/frameworks/native/opengl/libs/EGL/egl.cpp
df3ca30bf663cb8eed88ee3f16fb5e9a65dc00fc 05-May-2009 Mathias Agopian <mathias@google.com> 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.
/frameworks/native/opengl/libs/EGL/egl.cpp
7be3e5d2d8101a8f5e12bbdf650431a734f88eba 30-Apr-2009 Mathias Agopian <mathias@google.com> Merge commit 'goog/master' into merge_master

Conflicts:
libs/surfaceflinger/Layer.cpp
libs/surfaceflinger/SurfaceFlinger.cpp
opengl/libagl/egl.cpp
opengl/libs/EGL/egl.cpp
opengl/libs/GLES_CM/gl.cpp
opengl/libs/GLES_CM/gl_api.in
opengl/libs/gl_entries.in
opengl/libs/tools/glapigen
3d8817935b47ef67d86a872f64b1ba0e31ae6d0a 25-Apr-2009 Mathias Agopian <mathias@google.com> oops forgot to remove a LOGD when loading an opengl driver
/frameworks/native/opengl/libs/EGL/egl.cpp
1c2be6af86800875d57bb493fd6ce6b18d742dfe 24-Apr-2009 Mathias Agopian <mathias@google.com> Make sure to map undefined OES functions to their non-OES counterpart if it exists.
/frameworks/native/opengl/libs/EGL/egl.cpp
b519abb606c819c446a408f422530268b21a100b 24-Apr-2009 Mathias Agopian <mathias@google.com> use gl.h to generate the *.in files. we are now supporting the full gl.h and glext.h apis.
/frameworks/native/opengl/libs/EGL/egl.cpp
53238bddeab7b4633bfdb59fac67b0af1211955a 23-Apr-2009 Mathias Agopian <mathias@google.com> integrate some OpenGL ES changes back from master_gl in preparation of opening GLES to the NDK.
/frameworks/native/opengl/libs/EGL/egl.cpp
076b1cc3a9b90aa5b381a1ed268ca0b548444c9b 10-Apr-2009 Mathias Agopian <mathias@google.com> Integrate from //sandbox/mathias/donut/...@145728

SurfaceFlinger rework for new EGL driver model support.
/frameworks/native/opengl/libs/EGL/egl.cpp
749c63dbff0ab66223f30af1bad4ca56bd26d5d2 25-Mar-2009 Jack Palevich <> Automated import from //branches/master/...@142578,142578
/frameworks/native/opengl/libs/EGL/egl.cpp
87d80228cc6b8904da036d51d41252f8301e41d2 25-Mar-2009 Jack Palevich <> Automated import from //branches/donutburger/...@142484,142484
/frameworks/native/opengl/libs/EGL/egl.cpp
edbf3b6af777b721cd2a1ef461947e51e88241e1 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/native/opengl/libs/EGL/egl.cpp
d5193d9394c5e58176d7bcdf50ef017f8a3b9e1e 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/native/opengl/libs/EGL/egl.cpp
43aa2b1cbf7a03e248e10f4d0fec0463257cd52d 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@132589
/frameworks/native/opengl/libs/EGL/egl.cpp
0bb03408de8886e8d17013219967d42fb9c8cf8c 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@137055
/frameworks/native/opengl/libs/EGL/egl.cpp
d2bd26d32612a1c7d5629202e3f41741b7936c60 19-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@132276
/frameworks/native/opengl/libs/EGL/egl.cpp
a6938bab1f6fa76ae98ebbe44f4e534e05fa0993 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/native/opengl/libs/EGL/egl.cpp