From 3c03639cd525957a77071e53511834852f37609b Mon Sep 17 00:00:00 2001 From: zccrs Date: Fri, 28 May 2021 13:53:24 +0800 Subject: render: add get native paint target of renderer Add wlr_pixman_buffer_get_current_image for wlr_pixman_renderer. Add wlr_gles2_buffer_get_current_fbo for wlr_gles2_renderer. Allow get the FBO/pixman_image_t, the compositor can be add some action for FBO(for eg, attach a depth buffer), or without pixman render to pixman_image_t(for eg, use QPainter of Qt instead of pixman). --- render/gles2/renderer.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'render/gles2') diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index dad18975..baf53c72 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; +} -- cgit v1.2.3