#include "eglimage.h"
#include "eglsync.h"
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
-
struct wl_buffer;
struct dri2_egl_driver
#ifdef HAVE_X11_PLATFORM
xcb_connection_t *conn;
- int screen;
+ xcb_screen_t *screen;
int swap_available;
#ifdef HAVE_DRI3
struct loader_dri3_extensions loader_dri3_ext;
#ifdef HAVE_WAYLAND_PLATFORM
struct wl_display *wl_dpy;
+ struct wl_display *wl_dpy_wrapper;
struct wl_registry *wl_registry;
struct wl_drm *wl_server_drm;
struct wl_drm *wl_drm;
char *device_name;
#endif
+#ifdef HAVE_ANDROID_PLATFORM
+ const gralloc_module_t *gralloc;
+#endif
+
int is_render_node;
int is_different_gpu;
};
#ifdef HAVE_ANDROID_PLATFORM
struct ANativeWindow *window;
struct ANativeWindowBuffer *buffer;
- __DRIimage *dri_image;
+ __DRIimage *dri_image_back;
+ __DRIimage *dri_image_front;
/* EGL-owned buffers */
__DRIbuffer *local_buffers[__DRI_BUFFER_COUNT];
+
+ /* Used to record all the buffers created by ANativeWindow and their ages.
+ * Usually Android uses at most triple buffers in ANativeWindow
+ * so hardcode the number of color_buffers to 3.
+ */
+ struct {
+ struct ANativeWindowBuffer *buffer;
+ int age;
+ } color_buffers[3], *back;
#endif
#if defined(HAVE_SURFACELESS_PLATFORM)
extern const __DRIimageLookupExtension image_lookup_extension;
extern const __DRIuseInvalidateExtension use_invalidate;
+extern const __DRIbackgroundCallableExtension background_callable_extension;
EGLBoolean
dri2_load_driver(_EGLDisplay *disp);