aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorzccrs <zccrs@live.com>2021-05-28 13:53:24 +0800
committerSimon Ser <contact@emersion.fr>2021-06-19 10:04:35 +0200
commit3c03639cd525957a77071e53511834852f37609b (patch)
tree07b3839f9e3d1cb51c834efb504cfb277f18d44c /include
parentdc17ecd2365eaf9b5cb8f0193cdcb3991e788b4e (diff)
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).
Diffstat (limited to 'include')
-rw-r--r--include/wlr/render/gles2.h4
-rw-r--r--include/wlr/render/pixman.h5
2 files changed, 9 insertions, 0 deletions
diff --git a/include/wlr/render/gles2.h b/include/wlr/render/gles2.h
index a97b495c..dabe49dd 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 f417efa2..9a7be877 100644
--- a/include/wlr/render/pixman.h
+++ b/include/wlr/render/pixman.h
@@ -14,6 +14,11 @@
#include <wlr/render/wlr_renderer.h>
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);