backend: update present interface for partial updates

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-07-25 20:44:35 +01:00
parent bc3ca92e04
commit f86d6b7cbd
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
4 changed files with 8 additions and 8 deletions

View File

@ -285,7 +285,7 @@ void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) {
if (ps->backend_data->ops->present) { if (ps->backend_data->ops->present) {
// Present the rendered scene // Present the rendered scene
// Vsync is done here // Vsync is done here
ps->backend_data->ops->present(ps->backend_data); ps->backend_data->ops->present(ps->backend_data, NULL);
} }
#ifdef DEBUG_REPAINT #ifdef DEBUG_REPAINT

View File

@ -114,8 +114,7 @@ struct backend_operations {
void (*prepare)(backend_t *backend_data, const region_t *reg_damage); void (*prepare)(backend_t *backend_data, const region_t *reg_damage);
/** /**
* Paint the content of an image onto the (possibly buffered) * Paint the content of an image onto the back buffer
* target picture.
* *
* @param backend_data the backend data * @param backend_data the backend data
* @param image_data the image to paint * @param image_data the image to paint
@ -134,10 +133,11 @@ struct backend_operations {
const region_t *reg_blur, const region_t *reg_visible) const region_t *reg_blur, const region_t *reg_visible)
attr_nonnull(1, 3, 4, 5); attr_nonnull(1, 3, 4, 5);
/// Present the back buffer onto the screen. /// Present part of the back buffer onto the screen.
/// ///
/// Optional if the screen is not buffered /// @param region part of the screen that should be updated. if NULL, update the
void (*present)(backend_t *backend_data) attr_nonnull(1); /// whole screen
void (*present)(backend_t *backend_data, const region_t *region) attr_nonnull(1);
/** /**
* Bind a X pixmap to the backend's internal image data structure. * Bind a X pixmap to the backend's internal image data structure.

View File

@ -436,7 +436,7 @@ err:
return NULL; return NULL;
} }
static void glx_present(backend_t *base) { static void glx_present(backend_t *base, const region_t *region attr_unused) {
struct _glx_data *gd = (void *)base; struct _glx_data *gd = (void *)base;
gl_present(base); gl_present(base);
glXSwapBuffers(gd->display, gd->target_win); glXSwapBuffers(gd->display, gd->target_win);

View File

@ -301,7 +301,7 @@ static void deinit(backend_t *backend_data) {
free(xd); free(xd);
} }
static void present(backend_t *base) { static void present(backend_t *base, const region_t *region attr_unused) {
struct _xrender_data *xd = (void *)base; struct _xrender_data *xd = (void *)base;
if (xd->vsync) { if (xd->vsync) {