summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/egl_dri2.h
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2011-11-25 11:59:02 +0800
committerChia-I Wu <[email protected]>2011-11-25 12:34:33 +0800
commit75cc24c876059d6eb183e07ed802f997fb416864 (patch)
treed54eaf925a263684e7086a8671db540636e0660d /src/egl/drivers/dri2/egl_dri2.h
parent42c2c371d6c4c82c3e9176e028281a91edfadafd (diff)
android: add support for ICS
With ICS (Android 4.0), several headers and structs are renamed. Define ANDROID_VERSION so that we can choose a different path depending on the platform version. I've tested only softpipe and llvmpipe. r600g is also reported to work.
Diffstat (limited to 'src/egl/drivers/dri2/egl_dri2.h')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index 1c2c7fe5a64..95b87b87500 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -50,12 +50,21 @@
#ifdef HAVE_ANDROID_PLATFORM
#define LOG_TAG "EGL-DRI2"
-#include <ui/egl/android_natives.h>
-#include <ui/android_native_buffer.h>
-#include <cutils/log.h>
-#include <gralloc_drm_handle.h>
+
+#if ANDROID_VERSION >= 0x0400
+# include <system/window.h>
+#else
+# define android_native_buffer_t ANativeWindowBuffer
+# include <ui/egl/android_natives.h>
+# include <ui/android_native_buffer.h>
#endif
+#include <hardware/gralloc.h>
+#include <gralloc_drm_handle.h>
+#include <cutils/log.h>
+
+#endif /* HAVE_ANDROID_PLATFORM */
+
#include "eglconfig.h"
#include "eglcontext.h"
#include "egldisplay.h"
@@ -167,8 +176,8 @@ struct dri2_egl_surface
#endif
#ifdef HAVE_ANDROID_PLATFORM
- android_native_window_t *window;
- android_native_buffer_t *buffer;
+ struct ANativeWindow *window;
+ struct ANativeWindowBuffer *buffer;
/* EGL-owned buffers */
__DRIbuffer *local_buffers[__DRI_BUFFER_COUNT];