History log of /development/tools/emulator/opengl/system/egl/egl.cpp
Revision Date Author Comments
4d57cb8d6542f7fd82614a082de4b835de0d60eb 18-Jul-2012 Eino-Ville Talvala <etalvala@google.com> gralloc: Add automatic format selection. DO NOT MERGE

Have gralloc_alloc be able to select the appropriate pixel format
given the endpoints, triggered by new
GRALLOC_EMULATOR_PIXEL_FORMAT_AUTO format.

Currently supports camera->screen, and camera->video encoder.

Bug: 6243944
Change-Id: Ib1bf8da8d9184ac99e7f50aad09212c146c32809
ac4d519f43bd6587b3eafb68dab0861ba4fe4b5b 18-Jul-2012 Eino-Ville Talvala <etalvala@google.com> gralloc: Add automatic format selection

Have gralloc_alloc be able to select the appropriate pixel format
given the endpoints, triggered by new
GRALLOC_EMULATOR_PIXEL_FORMAT_AUTO format.

Currently supports camera->screen, and camera->video encoder.

Bug: 6243944
Change-Id: Ib1bf8da8d9184ac99e7f50aad09212c146c32809
e705cdde0db7dc9e85cbca0d9924e4432b5d1c7c 22-Jun-2012 Jesse Hall <jessehall@google.com> Update to renamed ANativeWindow methods

A few ANativeWindow methods were updatd to take a Sync HAL file
descriptor, and the existing methods were renamed with a _DEPRECATED
suffix. Since the emulator graphics acceleration doesn't yet support
the sync HAL, this change continues calling the deprecated functions
via their new names.

Change-Id: I5b1760811fafb6723ede887e32e63f94cbaeffe5
56513f5ff4f3e851c5f0cb38dc8851d18616b3c0 30-May-2012 Jesse Hall <jessehall@google.com> Move emugl system code to development.git

Because of the way the SDK and Android system images are branched,
host code that goes into the SDK tools can't live in the same
repository as code that goes into the system image. This change keeps
the emugl host code in sdk.git/emulator/opengl while moving the emugl
system code to development.git/tools/emulator/opengl.

A few changes were made beyond simply cloning the directories:

(a) Makefiles were modified to only build the relevant components. Not
doing so would break the build due to having multiple rule
definitions.

(b) Protocol spec files were moved from the guest encoder directories
to the host decoder directories. The decoder must support older
versions of the protocol, but not newer versions, so it makes
sense to keep the latest version of the protocol spec with the
decoder.

(c) Along with that, the encoder is now built from checked in
generated encoder source rather than directly from the protocol
spec. The generated code must be updated manually. This makes it
possible to freeze the system encoder version without freezing the
host decoder version, and also makes it very obvious when a
protocol changes is happening that will require special
backwards-compatibility support in the decoder/renderer.

(d) Host-only and system-only code were removed from the repository
where they aren't used.

(e) README and DESIGN documents were updated to reflect this split.

No actual source code was changed due to the above.

Change-Id: I2c936101ea0405b372750d36ba0f01e84d719c43
80d4ba77162126cfb60f9ca75f8a1d3a458ed31f 18-Apr-2012 Jesse Hall <jessehall@google.com> Move emulator GLES from development.git to sdk.git

The emulator GLES support has two interfaces: a host shared library
interface used by QEMU, and a protocol between the platform and the
host. The host library interface is not versioned; QEMU and the GLES
renderer must match. The protocol on the other hand must be backwards
compatible: a new GLES renderer must support an older platform image.

Thus for branching purposes it makes more sense to put the GLES
renderer in sdk.git, which is branched along with qemu.git for SDK
releases. Platform images will be built against the protocol version
in the platform branch of sdk.git.

Change-Id: Ie73fce12815c9740e27d0f56caa53c6ceb3d30cc
b62e28ddde79314f9d556f8755b1c08dff9cdabd 16-Apr-2012 Jesse Hall <jessehall@google.com> Move emulator GLES from development.git to sdk.git

The emulator GLES support has two interfaces: a host shared library
interface used by QEMU, and a protocol between the platform and the
host. The host library interface is not versioned; QEMU and the GLES
renderer must match. The protocol on the other hand must be backwards
compatible: a new GLES renderer must support an older platform image.

Thus for branching purposes it makes more sense to put the GLES
renderer in sdk.git, which is branched along with qemu.git for SDK
releases. Platform images will be built against the protocol version
in the platform branch of sdk.git.

Change-Id: Ibe2cf8de13520aa3fcbaf72328a15ece261d7b86
a3b1c787672074f90807f57266c7044955813e38 25-Feb-2012 Mathias Agopian <mathias@google.com> remove dependency on android_natives_priv.h

Change-Id: If06ea9aeb836d6ceb09745770956a25211f428d3
7ef79e49c7e8f1ecf19a92114f41de39d102a3e8 25-Feb-2012 Jesse Hall <jessehall@google.com> EmuGL: don't [de]queue buffers in eglMakeCurrent

Whenever a surface was attached to a context, it was dequeing a new
buffer, and enqueing it when detached. This has the effect of doing a
SwapBuffers on detach/attach cycle, which is just wrong and
occasionally caused visible glitches (e.g. animations going backwards
for one frame). It also broke some SurfaceTexture tests which
(validly) depend on specific buffer production/consumption counts.

Change-Id: Ibd4761e8842871b79fd9edf52272900193cb672d
cbc7300cb209a4fd3b250546c72c35b7bb0aa8a1 24-Feb-2012 Jesse Hall <jessehall@google.com> EmuGL: enable SurfaceTexture async mode

Pass the swap interval from eglSwapInterval to the native window so it
can enable/disable SurfaceTexture's async mode. Fixes the deadlock in
SurfaceTextureGLToGLTest.EglDestroySurfaceUnrefsBuffers.

Change-Id: I19bf69247341f5617223722df63d6c7f8cf389c6
ac018fe3f65e18083a2dd317f73e4139bfa5fee6 21-Feb-2012 Jesse Hall <jessehall@google.com> EmuGL: refcount ColorBuffers on the host

The gralloc API assumes system-wide reference counting of gralloc
buffers. The host-GL accelerated gralloc maps buffers to host-side
ColorBuffer objects, but was destroying them unconditionally in
gralloc_free(), ignoring any additional references from
gralloc_register_buffer().

This affected the SurfaceTexture gralloc buffers used by the
Browser/WebView. For some reason these buffers are actually allocated
by SurfaceFlinger and passed back to the WebView through Binder. But
since SurfaceFlinger doesn't actually need the buffer for anything,
sometime after the WebView has called gralloc_register_buffer()
SurfaceFlinger calls gralloc_free() on it. This caused the host
ColorBuffer to be destroyed long before the WebView is done using it.

Change-Id: I33dbee887a48a6907041cf19e9f38a1f6c983eff
5a622cba8c5287d5e6577f940a22343a7cae977f 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: Ic6cac56d137f705dfa7266f21e9b0269219bd5d1
6aff44c27ee487bd65d5a1c74faf4b7165530bd4 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE

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

Bug: 5449033
Change-Id: I03c41e20d8f5d7f3c7ef1f01506885e3e250e921
b0a30e43889415a9a40b9519392ad3be295b9465 12-Dec-2011 Jesse Hall <jessehall@google.com> EmuGL: remove broken EGL buffer refcounting

The emulator EGL implementation tried to hold its own reference to
buffers acquired/released with dequeueBuffer/queueBuffer, but was
missing an incRef after dequeueBuffer during swapBuffers.

Since the native window holds a reference to the buffer between
dequeueBuffer and queueBuffer, the EGL reference isn't needed anyway.

Change-Id: I95e4f9f4faf59198f99939cdca6603fe176c56bc
9c1439679116a79d924410c4a5dc74573201cd15 16-Nov-2011 Mathias Agopian <mathias@google.com> should fix sdk build

Change-Id: I5b403056f5245eae9a6476d9d573a3b1c25ea0c6
0e205e6d6e8a032683597a0a1293925b7b9e462d 19-Oct-2011 David 'Digit' Turner <digit@google.com> emulator: opengl: minor fix and reformatting

This patches fixes a minor invalid usage of delete (instead of delete[])
and reformats the source code a little to make it more obvious.

Change-Id: If853d12e74549abcc6682430c837b0f14da81fdc
4e6af749d5996edd6558821a7e400427f0457306 16-Sep-2011 David 'Digit' Turner <digit@google.com> emulator: opengl: Back-port GLES emulation from the master tree.

The modules here are only built when BUILD_EMULATOR_OPENGL is defined to true
in your environment or your BoardConfig.mk (see tools/emulator/opengl/Android.mk)

Change-Id: I5f32c35b4452fb5a7b4d5f9fc5870ec1da6032e6
f6b92410941840f250603904b5c13b7c73c3f4c3 07-Aug-2011 Guy Zadickario <guy@graphtech.co.il> opengles emulator: support glEGLImageTargetRenderbufferStorageOES

needed changes to support glEGLImageTargetRenderbufferStorageOES,
added implementation in egl and added tokens to renderControl.

Also fixed function pointers returned by eglGetProcAddress to
return functions that works independant of the current context,
see system/egl/ClientAPIExts.cpp

That makes the egl_image conformance test to pass on the guest.

Change-Id: I580cda82ba0fb44f12b75aa0bbacf5cd9f15f744
e99305dd9f4bfa0bc16cea025dd829b2aa5b8030 26-Jul-2011 Stas Gurtovoy <stas@graphtech.co.il> opengles emulator: cache all buffer on the guest

This is needed to support the rare, but still legal scenario,
when glDrawElemets is used with some index array data is stored in VBO's
while the actual attributes (vertices) data is in immediate mode.
When in immediate mode, we need to process the incodes, in order to know
which vertex data to send, which was impossible without the caching.
This commit introduces a new class GLSharedGroup, which will hold all data
that can be shared by shared contexts (buffers are such data).
This also makes the "Jet Cars Stunts" app work properly.

Change-Id: Ic937080dae461bc8cdf4d10cf37066a6e847f464
8f887e6f0802885337459ed18f1688eec2bdddcf 20-Jul-2011 Stas Gurtovoy <stas@graphtech.co.il> opengles emulator: fix eglGetError

eglGetError should set it's internal state to EGL_SUCCESS after every call

Change-Id: I55d1e5b2a03bae8b332c78e8179edd79c9e8e79e
39c53186b90cac1f301f5fa3cd4697af40e06eed 18-Jul-2011 Stas Gurtovoy <stas@graphtech.co.il> opengles emulator: inc/dec ref-count of buffer on SwapBuffers

On every swapBuffers, we make sure to decRef on the prev buffer,
and incRef on the current buffer. This fixes all the anoying
crashes on application exit, and also after the speech windows
on Replica Island

Change-Id: I1981fbf17a24ef6f60cdcf6d7ec3a5e7eef5377f
201584b1d4e352ef1236e67c4705bf232a2b36b2 11-Jul-2011 Stas Gurtovoy <stas@graphtech.co.il> egl emulator: fixes for covegl conformance test

Support for eglChooseConfig with configs==NULL.
Also added small change to query EGL_LARGEST_PBUFFER attrib of surfaces.
Fixed error print in QemuPipeStream::readFully.

Those changes make sure that covegl completes & passes on the emulator with Translator
on linux in the backend.

Change-Id: I892917ec102ae85d56a16a7cb321e8c12e7083f1
2782c5a061ebbce89c0d00e31c960d130178f179 30-Jun-2011 Liran <liran@graphtech.co.il> System egl: fix eglInitialize

fix eglInitialize to accept NULL in major/minor parameters
62d074d9f8d86f231a3094f2474700c805d20e7a 16-Jun-2011 Stas Gurtovoy <stas@graphtech.co.il> emulator opengl: add GLESv2 support to driver + renderer

Added GLESv2 library to system.
Made fixes to the host libOpenGLRender to
compile and support GLESv2 (defined WITH_GLES2).
Other fixes required to make GLESv2 to work.

Change-Id: I9eb198e6092e7fa3550342c50929dd1714282cb3
0536060b40190ccd5484ec9761d1f3eb2957d39c 13-Jun-2011 Guy Zadikario <guy@graphtech.co.il> emulator opengl: guest/host rendering syncronization.

Added a return value for rcFlushWindowColorBuffer and
rcUpdateColorBuffer in order to make those calls to block
with a round-trip to the host. This is to make sure that
the color buffer is up-to-date before the flinger use it
for rendering.
Also added a call to the native windows's lock function after
EGL is attached and bound to render on the window. This call
was missed before.

This syncronization can be optimized by removing the round-trip
and insert sync primitive to the stream at every draw command that
reads from a color buffer to make the sync happen on the host
before rendering the color buffer and remove the need for the
guest to wait for that update.

Change-Id: I1c2d8bc407b69663e992a68d5aa755f19bbe0ec3
128f401e4f6eee67690cb7ec77616f7503af5971 09-Jun-2011 Stas Gurtovoy <stas@graphtech.co.il> emulator opengles: Fixed a bug in eglChooseConfig implementation.

The config_size argument in rcChooseConfig should match the number
of requested configs and not the size in bytes to store it.
Moved the configs array size computation into rendeerControl.attrib.

Change-Id: I9e797024522965a656764c20252b25ff5ae657f5
1ef706f96feb479d7ec4347bbd320431f2cac037 04-Jun-2011 Guy Zadikario <guy@graphtech.co.il> emulator opengl: implement glGetString

Added rcGetGLString token to renderControl to query
a GL string constant from the current context from the host.
Implement glGetString functinality in EGL so that the string
value can be cached in the context structure and also
implementation can be shared between GLESv1 and GLESv2.

Also, fixed clientAPI context initialization check in
eglMakeCurrent. The check was for the previously bounded
context instead for the newly bounded context.

Change-Id: I41c0b4ad462c9ad5bd5c66719b41509bb1b7a947
6a79e88f018d26331539e20fb55db740d0751ee8 31-May-2011 Stas Gurtovoy <stas@graphtech.co.il> emulator opengl: pool of fixups to the system components.

Those fixes make the system load without failure.
Also the flinger and bootanimation are running.

Change-Id: Ieb7039e76c444df778a421a07bccc48514199245
2220d27302d201ac8e1f320195dd1420b981573b 15-May-2011 Stas Gurtovoy <stas@graphtech.co.il> emulator opengl: added Bind texture to EGLImage/surface

added functionality to bind an EGLImage to a texture both
in the system and host sides.

Change-Id: I2dc26090b45da080ac4d0e8f5799c95f7cc54634
de40cd3cc84c3da5a077024b54e7c6444883ec31 07-May-2011 Stas Gurtovoy <stas@graphtech.co.il> emulator opengl: Small change to support more surface attributes

Change-Id: I14d630d50c8505dabcd065e6187bd6d6509c312b
a7b7e95b039f51123ebcb6fd5ff05e7967f4f50e 04-May-2011 Stas Gurtovoy <stas@graphtech.co.il> emulator opengl: implement eglChooseConfig functionality.

Added new RenderControl command to request the host to execute
the ChooseConfig functionality.

Change-Id: Ib92be313a6df740de69d671c6994ec6cae17ea13
33dc9add2aba3caaafca9a7c6525ff341e777444 03-May-2011 Stas Gurtovoy <stas@graphtech.co.il> emulator opengl: some system egl fixes after a review.

Change-Id: I4a0c72319e8c69fba8ac00ed7bfff7667ae07269
c36ac6ed2f08c63dfea0606ce5f196ab162b2674 02-May-2011 Stas Gurtovoy <stas@graphtech.co.il> emulator opengl: moved gralloc buffer handle struct to be shared.

We need to share the cb_hande_t between gralloc/EGL/GLES, moved it
into the opengl system common lib.
Also added eglSwapBuffers implementation.

Change-Id: Ia461a48c273af42293aafcf084e457adf03cbed3
dd0a3777bcfc631f2a22b4c8b6dbcf8c63d70b40 01-May-2011 Stas Gurtovoy <stas@graphtech.co.il> Handle egl context

Added EGLContext functionality to emulator's accelerated EGL implementation.

Change-Id: Idde7d701808839f8d89c6c081a9f3216bdea7a52
8a8c601c4f758cb4a0d7694dc6ec67bd13cbc90f 01-May-2011 Stas Gurtovoy <stas@graphtech.co.il> emulator opengl: Create and destroy Surfaces

Also fixed link failure.

Change-Id: I4cbe28b2d51a5d4e48c4cba72df64f9df0898da5
37db3deb7bfddffa66b16297b5afdd7c750ff072 26-Apr-2011 Stas Gurtovoy <stas@graphtech.co.il> First commit of the system egl implementation.

At this point system/egl should build without errors

Change-Id: Ieabae930fc20a8df4f3d68f179d685401e946e74