summaryrefslogtreecommitdiffstats
path: root/video/out/opengl
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-02-13 18:07:20 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-13 17:45:29 -0800
commitf17246fec15963e7cc098cf7ba7263ad02877b99 (patch)
tree45689c1cd1200df665969d4ea75d3dab17de1c46 /video/out/opengl
parentceca1602e9360564a780036597dfe904566611ff (diff)
downloadmpv-f17246fec15963e7cc098cf7ba7263ad02877b99.tar.bz2
mpv-f17246fec15963e7cc098cf7ba7263ad02877b99.tar.xz
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.
Diffstat (limited to 'video/out/opengl')
-rw-r--r--video/out/opengl/context.c26
1 files changed, 0 insertions, 26 deletions
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,