From 2fe81ce7893e11a54db890a2c3b7eed85262b4c6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 16 Mar 2015 20:10:48 +0100 Subject: vo_opengl: move glViewport call closer to draw call --- video/out/gl_osd.c | 2 ++ video/out/gl_video.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/video/out/gl_osd.c b/video/out/gl_osd.c index 5c203ea626..74074915a2 100644 --- a/video/out/gl_osd.c +++ b/video/out/gl_osd.c @@ -375,6 +375,8 @@ void mpgl_osd_draw_part(struct mpgl_osd *ctx, int vp_w, int vp_h, int index) int div[2]; get_3d_side_by_side(ctx->stereo_mode, div); + ctx->gl->Viewport(0, 0, vp_w, abs(vp_h)); + for (int x = 0; x < div[0]; x++) { for (int y = 0; y < div[1]; y++) { struct gl_transform t; diff --git a/video/out/gl_video.c b/video/out/gl_video.c index ae9df7cad1..e091bdd749 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -823,6 +823,7 @@ static void render_pass_quad(struct gl_video *p, int vp_w, int vp_h, sizeof(struct vertex_pt[TEXUNIT_VIDEO_NUM])); } + p->gl->Viewport(0, 0, vp_w, abs(vp_h)); gl_vao_draw_data(&p->vao, GL_TRIANGLE_STRIP, va, 4); debug_check_gl(p, "after rendering"); @@ -835,7 +836,6 @@ static void finish_pass_direct(struct gl_video *p, GLint fbo, int vp_w, int vp_h GL *gl = p->gl; pass_prepare_src_tex(p); gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); - gl->Viewport(0, 0, vp_w, vp_h < 0 ? -vp_h : vp_h); gl_sc_gen_shader_and_reset(p->sc); render_pass_quad(p, vp_w, vp_h, dst, flags); gl->BindFramebuffer(GL_FRAMEBUFFER, 0); @@ -1876,7 +1876,6 @@ void gl_video_render_frame(struct gl_video *p, int fbo, struct frame_timing *t) draw_osd: gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); - gl->Viewport(0, 0, p->vp_w, abs(p->vp_h)); mpgl_osd_generate(p->osd, p->osd_rect, p->osd_pts, p->image_params.stereo_out); -- cgit v1.2.3