This fixes the glgen code generation for methods
which have a buffer arg that can be NULL.
Bug: 6845189
Change-Id: I5fb745b806601e5665f97bfd15fd865cd9c241ed
- Process is killed by system with SIGBUS signal if it writes
data to mapped sparse file on full filesystem.
- Allocate space using write() function instead of ftruncate()
to avoid creation of sparse files on full filesystem.
Catch write() errors to handle out-of-space case during allocation.
Bug: http://code.google.com/p/android/issues/detail?id=35376
Change-Id: Ifc366454f34e71a43a0973eda4f591a920ea3a14
Signed-off-by: Kirill Artamonov <kartamonov@nvidia.com>
this adds correct versions of the broken GLES20 methods
glGetShaderSource, glGetActiveAttrib and glGetActiveUniform.
the old broken methods are still there and need to be @hide later.
Bug: 6006380
Change-Id: Ide74242ada54b85459b459ae4f20cd26a23c7610
This changes generation of the OpenGL bindings to prevent
crashes of methods with more then one nio buffer argument.
Bug: 6772416
Change-Id: I4eff25c2f568dea78a6ffd3e95ff4620ab4b3b7d
This fixes lighting when using point lights, when eye space
lighting is used (which is the default).
Change-Id: I0cd0d2329893d6b5f8af3b1e595274c2076fc322
This change updates the uses of ANativeWindow to use the new ANW functions that
accept and return Sync HAL fence file descriptors.
Change-Id: I3ca648b6ac33f7360e86754f924aa072f95242f6
The acquire and release fences aren't yet used; this is just support
for the new version and temporary backwards compatibility for older
versions.
Change-Id: Ia5ccc05a97c86f649042b9a35e11042fa0187e84
this allows us to enable h/w acceleration on low-end
devices while keeping memory usage down.
Bug: 6557760
Change-Id: I8af2de3038dc2579360b8b73aa452cb7a0e506a9
Implementing this in libagl allows us to start using it for
SurfaceTexture in emulator builds, which is necessary to avoid
corruption in the Browser when using the host-accelerated GL path.
Bug: 6515813
Change-Id: Icafba8687cb5d010d8d42b3866b298d2be984fc9
Currently, gltrace offers very few trace collection options. As a
result, these options are encoded in a single integer. The trace
control task simply receives integers and interprets them as
commands.
This patch changes the control protocol to first receive the
command length followed by the actual command itself. This allows
for future flexibility to provide enable other commands.
Change-Id: Id5f56c80a025bbbe7613ab4457e092732e7d9dc9
Hibernating EGL takes a long time (>100 ms) and blocks all other
rendering. During window animations, the outgoing activity begins
hibernation before the animation stops, causing visible stutter.
Hibernation is still available by setting 'BOARD_ALLOW_EGL_HIBERNATION
:= true' in the devices BoardConfig.mk
Change-Id: Iab4e00723a1adcd97481e81b2efdc821b3e9712f
When eglTerminate() is called with a window surface still exists, a
deadlock would occur since egl_display_t::terminate() holds a lock
while destroying the window surface, which calls
onWindowSurfaceDestroyed() which attempts to take the same lock.
This change refactors the hibernation code and data into a separate
object with its own lock, separate from the egl_display_t lock. This
avoids the deadlock and better encapsulates the hibernation logic.
The change also fixes a bug discovered incidentally while debugging:
hibernating after calling eglTerminate() succeeds, but will cause
awakens from subsequent eglInitialize() to fail. We will no longer
hibernate a terminated display.
Change-Id: If55e5bb603d4f8953babc439ffc8d8a60af103d9
This tests if eglTerminate can succeed while objects
are leaked. Currently the test fails because of a deadlock.
Change-Id: Ibe26edfda28691284d0674e803e8d3114f3ce4c6
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
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
This change adds a debug option to EGL to use an EGLSyncKHR each frame to
determine when the GPU finishes rendering the frame.
Change-Id: I09ce071db904b44f07ca814c586c291c8b59385a
Some of the tests in frameworks/native/opengl/tests depend on java
or jni, and shouldn't be in frameworks/native. Prevent them from
building in pdk builds for now.
Change-Id: Ie7a012513dd03992ac1f093bd245aeca826c9cb9
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
This patch enables tracing of vertex attribute data that
is specified using glVertexAttribPointer().
At the time the glVertexAttribPointer() call is made, we
only receive a pointer in client space, without any indication
of the size (# of attributes). This size is known only at
the time of the glDraw() call.
This patch generates a new message glVertexAttribPointerData()
when a draw call is issued that contains the vertex attribute
data.
A glDrawArrays() call directly gives the size of data to copy.
A glDrawElements() call gives the indices to copy. In such a
case, all data between the min & max indices drawn are copied
and sent to the host. To support glDrawElements() with an
element array buffer, this patch also adds state that maintains
a copy of all element array buffers.
Change-Id: I434da794a0aa9ada8e7474e219ffb1d79b183ecf
Currently, the trace API passes the pointers that need to be
patched up via 32 bit integers. Such code will not be 64 bit safe.
This patch sends all pointers in a separate array of pointers
for the fixup calls to read from.
Change-Id: If975333f11a6f6f9a74fba57de328affaed452a5
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
This patch updates the trace information for all glUniform*() calls
to have the right data (the actual uniforms that are passed).
In addition, as soon as a program is linked, information regarding
all the active attributes and uniforms is passed on to the debugger.
Change-Id: Icfbc6722789b42c413a845cf546577fa6de7da2b
this is possible now that we support only a single
EGL implementation. this allows a large code simplification.
Change-Id: I7a6b9db4c5d60f4407c6061e7a68729af63d5242
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
this was introduced in a recent change. eglMakeCurrent can
end up calling eglDestroyImageKHR via ANativewWindow::disconnect
when the consumer is in the same process.
we make sure we don't hold the lock while this is happening.
Change-Id: Id17fe4fd76eecf5f962cefb9aa32be41fc1b042d
it would happen when a context was made non-current, in this
case we would call the implementation's eglMakeCurrent() which
would succeed, if we're rescheduled at that point, another
eglMakeCurrent() could make that context current to another thread,
however, when we came back to the original call we would
overwrite egl_context_t internal state.
this is fixed by moving the critical section under
egl_display_t's lock.
Change-Id: I743c85696e13263d3a9570824940263df0caacdc
when increasing MAX_NUMBER_OF_GL_EXTENSIONS to 256
we also needed to create all the corresponding wrappers.
Change-Id: I90edaaf0885ccdfab48e7a1396bcf88e039cfb25
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
Export trace information via abstract Unix Domain Socket (UDS).
This allows tracing of applications without INTERNET permission,
and should be faster as well.
Change-Id: Iabb67fcc2bc2484afd8128af07dca723b81c52c6
Currently users do not have control over the amount of data
captured during tracing. This patch adds 3 settings that users
can enable/disable at runtime:
- capture framebuffer on eglSwap() calls
- capture framebuffer on glDraw*() calls
- capture texture data passed to glTexImage*() calls
Disabling these options when not needed signficantly decreases
the size of the trace file, and reduces performance overhead for
the running application.
These settings are stored in the per process GLTraceState.
A separate thread listens for commands from the host, and updates
the state based on the user commands.
Change-Id: Ic4518b94e8bcbc5330ac7138153721caa98b365d
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
Currently, gltrace always attaches the contents of the currently
bound framebuffer. This patch changes it to attach the contents
of FB0 on eglSwap, and the currently bound framebuffer for the
glDraw* calls.
Change-Id: Ice0520d45d75638fe61cd91149df773074216510
Currently, the contents of the FrameBuffer are sent by encoding
them as the last argument to the function call. As a result, it is
not possible to know if a message has the framebuffer encoded in it
without looking at the function type.
This patch modifies the protobuf definition to include a separate
optional framebuffer message.
Change-Id: Ief3a6950052d927ca0743e729457435b48c25a92
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
This change explicitly sets swap interval 1 on the window when an
EGLSurface is created to render to it.
Change-Id: I91eb29dbee3ae4a55076b921f084d503fbe94e03
This change introduces two new BoardConfig variables to control the size
limits of the EGL blob cache. MAX_EGL_CACHE_ENTRY_SIZE is the size
limit for values inserted into the cache, and MAX_EGL_CACHE_SIZE is the
size limit for all entries in the entire cache (including both keys and
values). If either of these BoardConfig variables are not defined then
a default size limit is used instead.
Change-Id: I6703d93f966b6389c6499f23d841e42339f9c9d7
This change adds Java definitions for the enums of the
GL_OES_EGL_image_external OpenGL ES extension.
Bug: 3482193
Change-Id: Ib50326f8be9b9cc9021753855c3846ddcdc5eaa2
- 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
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
This change adds the ANDROID suffix to the all the types and functions
defined by the EGL_ANDROID_blob_cache extension.
Change-Id: I087875b96d9a7053efb9c8d5614f9f765eed799d
This does not happen on high end gfx devices. This happens
only if only one EGL context is initialized in the current
process.
Change-Id: Ibd1737efdf84eef8a84108b05795440d1ae9964e
This change causes any insertions into the EGL cache to trigger an
attempt to save the cache contents to disk. The save operation is
deferred to allow multiple cache insertions to be batched up.
Change-Id: I6cfec9c0dbbef94d3f8880860e2a365dccc296c7
This change adds support for saving and loading the contents of the EGL
cache. It also adds some simple tests for the EGL cache.
Change-Id: I18e5e789e0897a0783d29d1c1e64d26de2dd44c4
This change makes the makes the stub EGL_ANDROID_blob_cache callbacks
actually use a BlobCache object.
Bug: 5474671
Change-Id: I5cbaae2dea3aad2fe306c9f57029c3f215a0863a
This change adds a stub cache implementation that gets passed to the
underlying EGL implementation at initialization time.
Change-Id: I14437c5b6f91b7a34a19bb02ad802e6e54f88d2a
always use GL_RGBA, GL_UNSIGNED_BYTE for screen capture
and make sure to handle GL_BGRA_EXT used on some gpu.
Change-Id: If9c973677fec8a5c4e72be22e7ef7d4bf5f008f4
This patch modifies the library loaded in libEGL.so to
handle the case of GLES emulation as follows:
- if we detect that we run inside the emulator, check the
GPU emulation status through ro.kernel.qemu.gles, which
will be set to 1 if supported, or 0 otherwise.
When trying to run on an older version of the emulator,
the kernel parameter will not be defined at all.
- if GPU emulation is supported, use egl.cfg as usual.
It will contain a line like "0 0 emulation" that will
load libEGL_android.so appropriately.
- nothing is changed if we don't run inside the emulator.
NOTE: Ideally, we would modify libEGL_emulation.so to
redirect all calls to libEGL_android.so in this case.
However, this turns out to be extremely tedious to implement
(too many functions with different signatures).
As such, it is much simpler to make the check before
loading the library.
Change-Id: I9930bc168d9013cc8700feedc57b979384467c37
This change moves the call to native_window_api_disconnect from
eglDestroySurface to the egl_surface_t destructor. The egl_surface_t
can outlive the external EGLSurface if eglDestroySurface is called while
the surface is made current on a thread.
Change-Id: I0df6117a5633c2a19935fe356579abdd76fc471f
the original connect/disconnect hooks are deprecated
and replace by api_connect/api_disconnect. the original
hooks are no no-ops.
api_connect/api_disconnect is now only called from the
android framework.
Bug: 5057915
Change-Id: I8ca64cd1acd6cabf915bf54689ec2e5f6dfa495a
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
This change fixes how the Android EGL layer overrides the size and
format of an ANativeWindow in eglCreateWindowSurface. The new behavior
is to leave the size untouched when overriding the format. The previous
behavior was to reset the ANativeWindow to use the default size set by
the ANativeWindow implementation.
It also adds two new 'perform' methods to the ANativeWindow interface:
set_buffers_dimensions and set_buffers_format, and redefines the
behavior of set_buffers_geometry to be the combination of these two new
methods.
Additionally, this change adds an error check for the return value of
the new native_window_set_buffers_format call, which required adding a
(stub) handler for to FramebufferNativeWindow.
Change-Id: I805c7ccd8d4730dfb132d10d8bc3fb058a0b9df1
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
CaptureDraw specifies how many glDrawArrays/Elements to glReadPixel
CaptureSwap similarly applies to eglSwapBuffers
Change-Id: Ie7a7e3392b4ecdc0659dcee04f4bab97c35267dc
Signed-off-by: David Li <davidxli@google.com>
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>
To allow auto generate of Debug_glReadPixels function.
Also added AfterGeneratedCall messag type, and client override
of expectResponse for improving protocol.
Also implemented callers for client to get shader/program iv & infolog
Change-Id: I8426de0be4b7ffcb8b2b4f063ad85d19a9d2d72e
Signed-off-by: David Li <davidxli@google.com>
Just use jniThrowException instead. Note that it would be trivial to throw
seemingly more appropriate exceptions (NullPointerException and
OutOfMemoryException in particular), but I'm only attempting to preserve
existing behavior here.
I also found shadowing bugs in some of the special-case functions, which
would previously always have leaked memory.
This also moves an accidental change to a generated file (ActivityThread ->
AppGlobals) into the generator, so it won't be overwritten in future.
Change-Id: Iab570310b568cb406c60dd0e2b8211f8a36ae590
Uses a SurfaceTexture feeding into a OpenGL ES2 GLSurfaceView. Also
uses accelerometer data and SurfaceTexture-provided timestamps for a
simple physics simulation which moves the camera preview oval in
response to device movement.
Change-Id: I275a0c6a4e25829d617e635b25e70e2a9c8455cb
Data format is uint32_t totalDecompressedSize, then repeat:
uint32_t chunkDecompressedSize, chunkCompressedSize, chunk data.
If chunkCompressedSize == 0, then chunk is not compressed.
Also start fixing integer sizes on server.
On client, set endianness to match server.
Change-Id: I0d5afa16976ea6019b91c4e21d284605da7e135e
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
caller.cpp Is generated by generate_caller_cpp.py
Hand written functions are in caller.h
Change-Id: I27ed9792df52569159a2d1b8a78207c7a7518537
Signed-off-by: David Li <davidxli@google.com>
to allow "stepping" in functions.
Also fix bug in reference frame.
Change-Id: Ia33620eaf2c5f4e615f7aad2df277b6afc617060
Signed-off-by: David Li <davidxli@google.com>
liblzf is in external/liblzf, it's BSD-type licence (optionally GPL2)
Change-Id: Idc7883fe2155f366cda384e64796a1493335ae4f
Signed-off-by: David Li <davidxli@google.com>
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
This change fixes the gl2_yuvtex test to use the stride chosen by the
gralloc implementation rather than hard-coding it.
Bug: 4081948
Change-Id: If7c96a20fc3fb1df2ff25e6afaa9f34dbad2002c
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>
Somewhat functional, refer to README for details.
Need to enable Android.mk to build.
It builds libGLES_android.so, which needs to replace
the one in system/lib/egl built by libagl.
Change-Id: Iec3aaa8f3963a4185d81955cd24019eb0c4a5850
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
The bug caused libagl to return 0 from eglGetError if an EGL error value
(including EGL_SUCCESS) was set on a different thread but not yet on the
current thread.
Bug: 3403756
Change-Id: Ifd965091d116745c2e22c121151ade9e78eb14c6
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
Enhancements include:
+ Change default delay after each set operation
from 0.1 to 0.0 seconds. This significantly
increases the default rate at which operations
are performed.
+ Make sourceCrop to displayFrame scale
factor of 1.0 a frequent occurance.
+ Enable use of RGB888 and YV12 graphic formats.
+ Add initCheck() call after creation of a
GraphicBuffer, to confirm it was created
without any errors.
Change-Id: I1606dff3924a23bdd5cb27ba302bebb4f200d768
(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
* commit '17fd21fc0638d8734867b6f189efbabb227f3ae1':
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
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
The code looks correct, but causes an internal compiler error on
simulator builds on mine (an other) gLucid desktops.
Change-Id: Iaf0d8120778ec1c6fc739ef13e6eaaac53e3bcc8
affects software renderer (emu) only.
per EGL spec:
If EGL_MAX_PBUFFER_WIDTH, EGL_MAX_PBUFFER_HEIGHT,
EGL_MAX_PBUFFER_PIXELS, or EGL_NATIVE_VISUAL_ID are specified
in attrib list, then they are ignored
Change-Id: I3d5214ce896986da2f11d2eb1889afc41731eaa6
Merge commit '49af98ed877e8a2db5a6b5be811c798e6f73dff7'
* commit '49af98ed877e8a2db5a6b5be811c798e6f73dff7':
fix [3119687] [Maps][4.6.0] Force close in street view
Merge commit 'aa6df3669deab2a804c6f8cc1ea3fd5af0a28685' into gingerbread-plus-aosp
* commit 'aa6df3669deab2a804c6f8cc1ea3fd5af0a28685':
fix [3119687] [Maps][4.6.0] Force close in street view
The EGLConfig attributes MUST be sorted, because they're used in a binary search.
A recent change introduced a bug where 2 of the configs had improperly
sorted attributes.
Change-Id: I1ac53e4463d62f27125ca9f82ed946e6c98ddba0
Merge commit '63ac8f5377833303a7f8c4d60f0d74daf903e6ea'
* commit '63ac8f5377833303a7f8c4d60f0d74daf903e6ea':
Add a test application to dump all the EGLConfig available
Merge commit 'add9db83fdbf939f0610f8b357788fd3e8ad9ab5'
* commit 'add9db83fdbf939f0610f8b357788fd3e8ad9ab5':
fix [2236865] STOPSHIP: bump soft gl and egl minor version number
Merge commit '2b2da52608303b149d22418865e67c8030c70e73' into gingerbread-plus-aosp
* commit '2b2da52608303b149d22418865e67c8030c70e73':
Add a test application to dump all the EGLConfig available
Merge commit 'f4cd9be0390135269e22e42fd2e1fe61fdcf9863' into gingerbread-plus-aosp
* commit 'f4cd9be0390135269e22e42fd2e1fe61fdcf9863':
fix [2236865] STOPSHIP: bump soft gl and egl minor version number
SW egl returned always EGL_FALSE even when the display was valid.
This made calls to eglSwapInterval to fail on HW since the wrapper
fails if either SW or HW egl fails.
Letting SW eglSwapInterval to return true when display is valid is
ok since spec says that interval parameter is silently clamped.
Change-Id: Ib4aa1dbfccf510a0f36621796e79a4d46852ee6a
Measures the time to do nothing but clear the screen in an
OpenGL Java app. Spews frame time statistics to the log.
Control long frame time by setting debug.longframe_ms;
e.g., adb shell setprop debug.longframe_ms 33
Change-Id: I435a3cb170048349e00417c44db42121c68744b2
Merge commit '4eb1ad5e98c7b36f7ac4ec8c3270f9763afd107e'
* commit '4eb1ad5e98c7b36f7ac4ec8c3270f9763afd107e':
better fix for [3028370] GL get error should return a valid error if no context is bound.
Merge commit '524a6d8e9bb4df9cec0520ac1d9733642b13e76f' into gingerbread-plus-aosp
* commit '524a6d8e9bb4df9cec0520ac1d9733642b13e76f':
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.
Merge commit '5c6c5c7a43d44316395f5c35ab713372124b8b4c' into gingerbread-plus-aosp
* commit '5c6c5c7a43d44316395f5c35ab713372124b8b4c':
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
Merge commit '9d5fac517463526450268bf6353e32c13a8cdd0c' into gingerbread-plus-aosp
* commit '9d5fac517463526450268bf6353e32c13a8cdd0c':
fix small bug in EGL error management