diff --git a/include/wlr/render/gles2.h b/include/wlr/render/gles2.h index a97b495c2..dabe49dde 100644 --- a/include/wlr/render/gles2.h +++ b/include/wlr/render/gles2.h @@ -21,6 +21,10 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl); struct wlr_egl *wlr_gles2_renderer_get_egl(struct wlr_renderer *renderer); bool wlr_gles2_renderer_check_ext(struct wlr_renderer *renderer, const char *ext); +/** + * Returns the OpenGL FBO of current buffer. + */ +GLuint wlr_gles2_renderer_get_current_fbo(struct wlr_renderer *wlr_renderer); struct wlr_gles2_texture_attribs { GLenum target; /* either GL_TEXTURE_2D or GL_TEXTURE_EXTERNAL_OES */ diff --git a/include/wlr/render/pixman.h b/include/wlr/render/pixman.h index f417efa20..9a7be8774 100644 --- a/include/wlr/render/pixman.h +++ b/include/wlr/render/pixman.h @@ -14,6 +14,11 @@ #include struct wlr_renderer *wlr_pixman_renderer_create(void); +/** + * Returns the image of current buffer. + */ +pixman_image_t *wlr_pixman_renderer_get_current_image( + struct wlr_renderer *wlr_renderer); bool wlr_renderer_is_pixman(struct wlr_renderer *wlr_renderer); bool wlr_texture_is_pixman(struct wlr_texture *texture); diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index dad189759..baf53c723 100644 --- a/render/gles2/renderer.c +++ b/render/gles2/renderer.c @@ -919,3 +919,9 @@ bool wlr_gles2_renderer_check_ext(struct wlr_renderer *wlr_renderer, struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer); return check_gl_ext(renderer->exts_str, ext); } + +GLuint wlr_gles2_renderer_get_current_fbo(struct wlr_renderer *wlr_renderer) { + struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer); + assert(renderer->current_buffer); + return renderer->current_buffer->fbo; +} diff --git a/render/pixman/renderer.c b/render/pixman/renderer.c index 56960fc23..f1c1a3d5e 100644 --- a/render/pixman/renderer.c +++ b/render/pixman/renderer.c @@ -567,3 +567,10 @@ pixman_image_t *wlr_pixman_texture_get_image(struct wlr_texture *wlr_texture) { struct wlr_pixman_texture *texture = get_texture(wlr_texture); return texture->image; } + +pixman_image_t *wlr_pixman_renderer_get_current_image( + struct wlr_renderer *wlr_renderer) { + struct wlr_pixman_renderer *renderer = get_renderer(wlr_renderer); + assert(renderer->current_buffer); + return renderer->current_buffer->image; +}