egl_dri2: add support for Android
authorChia-I Wu <olvaffe@gmail.com>
Fri, 5 Aug 2011 05:39:18 +0000 (14:39 +0900)
committerChia-I Wu <olv@lunarg.com>
Sun, 28 Aug 2011 13:56:23 +0000 (21:56 +0800)
commit9779f6f5c143506d71420d78bb51b2fa7c995378
treea2e1fe1c5f410341daa38c85120921c56a1f3730
parent58911b86a15676f116c693e84ea6b9ebabb906ed
egl_dri2: add support for Android

Add platform_android.c that supports _EGL_PLAFORM_ANDROID.  It works
with drm_gralloc, where back buffers of windows are backed by GEM
objects.

In Android a native window has a queue of back buffers allocated by the
server, through drm_gralloc.  For each frame, EGL needs to

  dequeue the next back buffer
  render to the buffer
  enqueue the buffer

After enqueuing, the buffer is no longer valid to EGL.  A window has no
depth buffer or other aux buffers.  They need to be allocated locally by
EGL.

Reviewed-by: Benjamin Franzke <benjaminfranzke@googlemail.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>
[olv: with assorted minor changes, mostly suggested during the review]
src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/dri2/egl_dri2.h
src/egl/drivers/dri2/platform_android.c [new file with mode: 0644]