Rebase wlr_drm_connector_read_pixels

This commit is contained in:
emersion 2017-10-07 11:03:53 +02:00
parent d0db6a80ab
commit 3eefd75e7e
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
1 changed files with 5 additions and 6 deletions

View File

@ -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); 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) { void *out_data) {
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output; int width, height;
struct wlr_drm_plane *plane = conn->crtc->primary; wlr_output_effective_resolution(output, &width, &height);
wlr_drm_plane_make_current(conn->renderer, plane); wlr_drm_connector_make_current(output);
glReadPixels(0, 0, plane->width, plane->height, GL_BGRA_EXT, GL_UNSIGNED_BYTE, glReadPixels(0, 0, width, height, GL_BGRA_EXT, GL_UNSIGNED_BYTE, out_data);
out_data);
} }
static void wlr_drm_connector_destroy(struct wlr_output *output) { static void wlr_drm_connector_destroy(struct wlr_output *output) {