aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/drm.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-03-20 23:10:42 +0100
committeremersion <contact@emersion.fr>2018-03-21 07:37:09 +0100
commit3581573bdcbe3c905eae83af53cccbcdd52edad2 (patch)
tree41290d6330facfe127b0a9ab4107bff364dc1967 /backend/drm/drm.c
parent95e86e675a7eef326958ab9047ff4ca0d0182cfc (diff)
render/gles2: make wlr_renderer_begin take viewport size
This allows raw GL calls outside wlr_renderer to be removed.
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r--backend/drm/drm.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 344756f8..345c0dd8 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -643,14 +643,13 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output,
wlr_texture_upload_pixels(plane->wlr_tex, WL_SHM_FORMAT_ARGB8888,
stride, width, height, buf);
- glViewport(0, 0, plane->surf.width, plane->surf.height);
- glClearColor(0.0, 0.0, 0.0, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
+ struct wlr_renderer *rend = plane->surf.renderer->wlr_rend;
+ wlr_renderer_begin(rend, plane->surf.width, plane->surf.height);
+ wlr_renderer_clear(rend, (float[]){ 0.0, 0.0, 0.0, 0.0 });
+ wlr_render_texture(rend, plane->wlr_tex, plane->matrix, 0, 0, 1.0f);
+ wlr_renderer_end(rend);
- wlr_render_texture(plane->surf.renderer->wlr_rend, plane->wlr_tex,
- plane->matrix, 0, 0, 1.0f);
-
- glFinish();
+ // TODO: remove these raw GL calls
glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, bo_stride);
glReadPixels(0, 0, plane->surf.width, plane->surf.height, GL_BGRA_EXT,
GL_UNSIGNED_BYTE, bo_data);