if (ctx && surf)
dri2_surf_update_fence_fd(ctx, disp, surf);
- ret = dri2_dpy->vtbl->swap_buffers_with_damage(drv, disp, surf,
- rects, n_rects);
+ if (dri2_dpy->vtbl->swap_buffers_with_damage)
+ ret = dri2_dpy->vtbl->swap_buffers_with_damage(drv, disp, surf,
+ rects, n_rects);
+ else
+ ret = dri2_dpy->vtbl->swap_buffers(drv, disp, surf);
/* SwapBuffers marks the end of the frame; reset the damage region for
* use again next time.
EGLBoolean (*swap_buffers)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf);
+ /* optional - falls back to .swap_buffers */
EGLBoolean (*swap_buffers_with_damage)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surface,
const EGLint *rects, EGLint n_rects);
struct wl_buffer;
-static inline EGLBoolean
-dri2_fallback_swap_buffers_with_damage(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLSurface *surf,
- const EGLint *rects, EGLint n_rects)
-{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
- return dri2_dpy->vtbl->swap_buffers(drv, disp, surf);
-}
-
static inline EGLBoolean
dri2_fallback_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf,
.destroy_surface = droid_destroy_surface,
.create_image = droid_create_image_khr,
.swap_buffers = droid_swap_buffers,
- .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage, /* Android implements the function */
.swap_buffers_region = dri2_fallback_swap_buffers_region,
.swap_interval = droid_swap_interval,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.destroy_surface = dri2_drm_destroy_surface,
.create_image = dri2_drm_create_image_khr,
.swap_buffers = dri2_drm_swap_buffers,
- .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_fallback_copy_buffers,
.destroy_surface = dri2_wl_destroy_surface,
.create_image = dri2_create_image_khr,
.swap_buffers = dri2_wl_swrast_swap_buffers,
- .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_fallback_copy_buffers,
.create_image = dri2_x11_create_image_khr,
.swap_interval = dri2_x11_swap_interval,
.swap_buffers = dri2_x11_swap_buffers,
- .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
.swap_buffers_region = dri2_x11_swap_buffers_region,
.post_sub_buffer = dri2_x11_post_sub_buffer,
.copy_buffers = dri2_x11_copy_buffers,
.create_image = dri3_create_image_khr,
.swap_interval = dri3_set_swap_interval,
.swap_buffers = dri3_swap_buffers,
- .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri3_copy_buffers,