dri2_set_damage_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLint *rects, EGLint n_rects)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
- return dri2_dpy->vtbl->set_damage_region(drv, disp, surf, rects, n_rects);
+ return false;
}
static EGLBoolean
_EGLSurface *surface,
const EGLint *rects, EGLint n_rects);
- EGLBoolean (*set_damage_region)(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLSurface *surface,
- const EGLint *rects, EGLint n_rects);
-
EGLBoolean (*swap_buffers_region)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf, EGLint numRects,
const EGLint *rects);
const EGLint *rects, EGLint n_rects)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
- dri2_dpy->vtbl->set_damage_region(drv, disp, surf, rects, n_rects);
return dri2_dpy->vtbl->swap_buffers(drv, disp, surf);
}
return _eglError(EGL_BAD_NATIVE_PIXMAP, "no support for native pixmaps");
}
-static inline EGLBoolean
-dri2_fallback_set_damage_region(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLSurface *surf,
- const EGLint *rects, EGLint n_rects)
-{
- return EGL_FALSE;
-}
-
static inline EGLint
dri2_fallback_query_buffer_age(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf)
return EGL_TRUE;
}
-#if ANDROID_API_LEVEL >= 23
-static EGLBoolean
-droid_set_damage_region(_EGLDriver *drv,
- _EGLDisplay *disp,
- _EGLSurface *draw, const EGLint* rects, EGLint n_rects)
-{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
- struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
- android_native_rect_t* droid_rects = NULL;
- int ret;
-
- if (n_rects == 0)
- return EGL_TRUE;
-
- droid_rects = malloc(n_rects * sizeof(android_native_rect_t));
- if (droid_rects == NULL)
- return _eglError(EGL_BAD_ALLOC, "eglSetDamageRegionKHR");
-
- for (EGLint num_drects = 0; num_drects < n_rects; num_drects++) {
- EGLint i = num_drects * 4;
- droid_rects[num_drects].left = rects[i];
- droid_rects[num_drects].bottom = rects[i + 1];
- droid_rects[num_drects].right = rects[i] + rects[i + 2];
- droid_rects[num_drects].top = rects[i + 1] + rects[i + 3];
- }
-
- /*
- * XXX/TODO: Need to check for other return values
- */
-
- ret = native_window_set_surface_damage(dri2_surf->window, droid_rects, n_rects);
- free(droid_rects);
-
- return ret == 0 ? EGL_TRUE : EGL_FALSE;
-}
-#endif
-
static _EGLImage *
droid_create_image_from_prime_fds_yuv(_EGLDisplay *disp, _EGLContext *ctx,
struct ANativeWindowBuffer *buf,
.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,
-#if ANDROID_API_LEVEL >= 23
- .set_damage_region = droid_set_damage_region,
-#else
- .set_damage_region = dri2_fallback_set_damage_region,
-#endif
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = droid_query_buffer_age,
disp->Extensions.ANDROID_image_native_buffer = EGL_TRUE;
disp->Extensions.ANDROID_recordable = EGL_TRUE;
disp->Extensions.EXT_buffer_age = EGL_TRUE;
-#if ANDROID_API_LEVEL >= 23
- disp->Extensions.KHR_partial_update = EGL_TRUE;
-#endif
disp->Extensions.KHR_image = EGL_TRUE;
#if ANDROID_API_LEVEL >= 24
if (dri2_dpy->mutable_render_buffer &&
.destroy_surface = device_destroy_surface,
.create_image = dri2_create_image_khr,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
- .set_damage_region = dri2_fallback_set_damage_region,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = dri2_fallback_query_buffer_age,
.swap_buffers = dri2_drm_swap_buffers,
.swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
- .set_damage_region = dri2_fallback_set_damage_region,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = dri2_drm_query_buffer_age,
.destroy_surface = surfaceless_destroy_surface,
.create_image = dri2_create_image_khr,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
- .set_damage_region = dri2_fallback_set_damage_region,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = dri2_fallback_query_buffer_age,
.swap_buffers = dri2_wl_swap_buffers,
.swap_buffers_with_damage = dri2_wl_swap_buffers_with_damage,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
- .set_damage_region = dri2_fallback_set_damage_region,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = dri2_wl_query_buffer_age,
.destroy_surface = dri2_x11_destroy_surface,
.create_image = dri2_create_image_khr,
.swap_buffers = dri2_x11_swap_buffers,
- .set_damage_region = dri2_fallback_set_damage_region,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
/* XXX: should really implement this since X11 has pixmaps */
.swap_buffers = dri2_x11_swap_buffers,
.swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
.swap_buffers_region = dri2_x11_swap_buffers_region,
- .set_damage_region = dri2_fallback_set_damage_region,
.post_sub_buffer = dri2_x11_post_sub_buffer,
.copy_buffers = dri2_x11_copy_buffers,
.query_buffer_age = dri2_fallback_query_buffer_age,
.swap_buffers = dri3_swap_buffers,
.swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
- .set_damage_region = dri2_fallback_set_damage_region,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri3_copy_buffers,
.query_buffer_age = dri3_query_buffer_age,