Skip to content

Commit

Permalink
backend: gl: implement root_change interface for glx & egl
Browse files Browse the repository at this point in the history
Co-authored-by: Monsterovich <[email protected]>
Signed-off-by: Yuxuan Shui <[email protected]>
  • Loading branch information
yshui and Monsterovich committed Feb 20, 2024
1 parent 9ac5166 commit fef7ff8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/backend/gl/egl.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ static void egl_diagnostics(backend_t *base) {
struct backend_operations egl_ops = {
.init = egl_init,
.deinit = egl_deinit,
.root_change = gl_root_change,
.bind_pixmap = egl_bind_pixmap,
.release_image = gl_release_image,
.prepare = gl_prepare,
Expand Down
5 changes: 5 additions & 0 deletions src/backend/gl/gl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,11 @@ static bool gl_win_shader_from_stringv(const char **vshader_strv,
return true;
}

void gl_root_change(backend_t *base, session_t *ps) {
auto gd = (struct gl_data *)base;
gl_resize(gd, ps->root_width, ps->root_height);
}

/**
* Callback to run on root window size change.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/backend/gl/gl_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ bool gl_last_render_time(backend_t *backend_data, struct timespec *time);
void gl_compose(backend_t *, image_handle image, coord_t image_dst, image_handle mask,
coord_t mask_dst, const region_t *reg_tgt, const region_t *reg_visible);

void gl_root_change(backend_t *base, session_t *);

void gl_resize(struct gl_data *, int width, int height);

bool gl_init(struct gl_data *gd, session_t *);
Expand Down
1 change: 1 addition & 0 deletions src/backend/gl/glx.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ static void glx_diagnostics(backend_t *base) {
struct backend_operations glx_ops = {
.init = glx_init,
.deinit = glx_deinit,
.root_change = gl_root_change,
.bind_pixmap = glx_bind_pixmap,
.release_image = gl_release_image,
.prepare = gl_prepare,
Expand Down

0 comments on commit fef7ff8

Please sign in to comment.