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
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
This change removes the check that disallowed the creation of an
EGLSurface that would send frames to a SurfaceTexture.
Change-Id: I44c6d5df503cc676a88144d72d39b414692ce4c9
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>
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
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
We were leaking all EGLSyncKHR objects, over time the list
would grow and become very slow to operate on.
Bug: 4107131
Change-Id: I6c82daf49fe3189d04550781d64d57c30c95f552
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
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>
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>
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>
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>
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
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
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
Return wrappers from GetProcAddress for glEGLImageTargetTexture2DOES
and glEGLImageTargetRenderbufferStorageOES which unwrap the EGLimage
handle before calling through to the implementation.
Change-Id: I2f5b180ab3ccdb28a4f510a2bd8c2eee941a84df
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
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
(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
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
Merge commit '4eb1ad5e98c7b36f7ac4ec8c3270f9763afd107e'
* commit '4eb1ad5e98c7b36f7ac4ec8c3270f9763afd107e':
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
Merge commit '9c4d7d677097981a349c718902e29050dad3d59f'
* commit '9c4d7d677097981a349c718902e29050dad3d59f':
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
make sure to clear our EGL implementation's error when returning
an error from an underlying implementation
Change-Id: Ibce4726cef1f900e4c7f16002345d7a07f8cdf41