From f17246fec15963e7cc098cf7ba7263ad02877b99 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 13 Feb 2018 18:07:20 +0100 Subject: vo_gpu: remove old window screenshot glue code and GL implementation There is now a better way. Reading the font framebuffer was always a hack. The new code via VOCTRL_SCREENSHOT renders it into a FBO, which does not come with the disadvantages of reading the front buffer (like not being supported by GLES, possibly black regions due to overlapping windows on some systems). For now keep VOCTRL_SCREENSHOT_WIN on the VO level, because there are still some lesser VOs and backends that use it. --- video/out/opengl/context.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'video/out/opengl') diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c index 8f44119210..0bf8d7436e 100644 --- a/video/out/opengl/context.c +++ b/video/out/opengl/context.c @@ -173,8 +173,6 @@ bool ra_gl_ctx_init(struct ra_ctx *ctx, GL *gl, struct ra_gl_ctx_params params) if (ext) { if (ext->color_depth) p->fns.color_depth = ext->color_depth; - if (ext->screenshot) - p->fns.screenshot = ext->screenshot; if (ext->start_frame) p->fns.start_frame = ext->start_frame; if (ext->submit_frame) @@ -247,29 +245,6 @@ int ra_gl_ctx_color_depth(struct ra_swapchain *sw) return depth_g; } -struct mp_image *ra_gl_ctx_screenshot(struct ra_swapchain *sw) -{ - struct priv *p = sw->priv; - - struct mp_image *screen = mp_image_alloc(IMGFMT_RGB24, p->wrapped_fb->params.w, - p->wrapped_fb->params.h); - if (!screen) - return NULL; - - int dir = p->params.flipped ? 1 : -1; - - assert(p->wrapped_fb); - if (!gl_read_fbo_contents(p->gl, p->main_fb, dir, GL_RGB, GL_UNSIGNED_BYTE, - p->wrapped_fb->params.w, p->wrapped_fb->params.h, - screen->planes[0], screen->stride[0])) - { - talloc_free(screen); - return NULL; - } - - return screen; -} - bool ra_gl_ctx_start_frame(struct ra_swapchain *sw, struct ra_fbo *out_fbo) { struct priv *p = sw->priv; @@ -353,7 +328,6 @@ void ra_gl_ctx_swap_buffers(struct ra_swapchain *sw) static const struct ra_swapchain_fns ra_gl_swapchain_fns = { .color_depth = ra_gl_ctx_color_depth, - .screenshot = ra_gl_ctx_screenshot, .start_frame = ra_gl_ctx_start_frame, .submit_frame = ra_gl_ctx_submit_frame, .swap_buffers = ra_gl_ctx_swap_buffers, -- cgit v1.2.3