Commit Graph

9 Commits

Author SHA1 Message Date
Jesse Hall
56513f5ff4 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
2012-06-06 09:46:29 -07:00
Jesse Hall
80d4ba7716 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
2012-04-18 06:26:17 -07:00
Jesse Hall
ac018fe3f6 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
2012-02-21 11:13:20 -08:00
Guy Zadickario
f6b9241094 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
2011-08-10 10:53:06 +02:00
Guy Zadikario
0536060b40 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
2011-06-25 16:56:08 +03:00
Guy Zadikario
1ef706f96f 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
2011-06-21 20:47:43 +02:00
Stas Gurtovoy
6a79e88f01 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
2011-06-21 01:41:50 +03:00
Stas Gurtovoy
a7b7e95b03 emulator opengl: implement eglChooseConfig functionality.
Added new RenderControl command to request the host to execute
the ChooseConfig functionality.

Change-Id: Ib92be313a6df740de69d671c6994ec6cae17ea13
2011-06-11 00:16:21 +03:00
Guy Zadikario
32fc922316 emulator opengl: renderControl API encoder/decoder
That adds the renderControl API encoder/decoder which is used for
guest to host control commands. See system/renderControl_enc/README
for more info about the API itself.

Change-Id: I2c72803137889d646fbb3d2a56ecdcf94b088f40
2011-04-13 13:33:26 +03:00