aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-03-21 11:34:08 +0100
committeremersion <contact@emersion.fr>2018-03-21 11:34:08 +0100
commit60bfe0a6aad6bc415f84a52326c9a0851fc647c0 (patch)
tree15e451953acde8e6e6ec1e71e44d527a82ad28b5 /backend/drm
parent8207f0f081d6b0e1c493366614be836c392c34fd (diff)
backend/drm: remove remaining raw GL call
This makes the hardware cursor code a less efficient. Can be fixed with a GLES3 renderer.
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/drm.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 345c0dd8..524e80bb 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -582,11 +582,8 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output,
return false;
}
- // OpenGL will read the pixels out upside down,
- // so we need to flip the image vertically
- enum wl_output_transform transform = wlr_output_transform_compose(
- wlr_output_transform_invert(output->transform),
- WL_OUTPUT_TRANSFORM_FLIPPED_180);
+ enum wl_output_transform transform =
+ wlr_output_transform_invert(output->transform);
wlr_matrix_projection(plane->matrix, plane->surf.width,
plane->surf.height, transform);
@@ -649,11 +646,8 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output,
wlr_render_texture(rend, plane->wlr_tex, plane->matrix, 0, 0, 1.0f);
wlr_renderer_end(rend);
- // 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);
- glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, 0);
+ wlr_renderer_read_pixels(rend, WL_SHM_FORMAT_ARGB8888, bo_stride,
+ plane->surf.width, plane->surf.height, 0, 0, 0, 0, bo_data);
wlr_drm_surface_swap_buffers(&plane->surf, NULL);