aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/drm.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-10-07 11:03:53 +0200
committeremersion <contact@emersion.fr>2017-10-07 16:22:03 +0200
commit3eefd75e7efa1b983fcb528ccee64f33e26e3c75 (patch)
treeeda220287ebdb898e2810ec088a89b0f8301c6ac /backend/drm/drm.c
parentd0db6a80ab64ee1f5d090677c18f57109b36575a (diff)
Rebase wlr_drm_connector_read_pixels
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r--backend/drm/drm.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index ec0c29f7..d08fa7f4 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -634,13 +634,12 @@ static bool wlr_drm_connector_move_cursor(struct wlr_output *output,
return drm->iface->crtc_move_cursor(drm, conn->crtc, x, y);
}
-static void wlr_drm_connector_read_pixels(struct wlr_output *_output,
+static void wlr_drm_connector_read_pixels(struct wlr_output *output,
void *out_data) {
- struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
- struct wlr_drm_plane *plane = conn->crtc->primary;
- wlr_drm_plane_make_current(conn->renderer, plane);
- glReadPixels(0, 0, plane->width, plane->height, GL_BGRA_EXT, GL_UNSIGNED_BYTE,
- out_data);
+ int width, height;
+ wlr_output_effective_resolution(output, &width, &height);
+ wlr_drm_connector_make_current(output);
+ glReadPixels(0, 0, width, height, GL_BGRA_EXT, GL_UNSIGNED_BYTE, out_data);
}
static void wlr_drm_connector_destroy(struct wlr_output *output) {