gl/color: restore viewport dimensions when fbo done

Regression introduced by 95abfda139.
It caused to display the wrong frame size when resizing the window.
This commit is contained in:
Julien Isorce 2014-04-13 00:21:00 +01:00 committed by Matthew Waters
parent 47f7bf269a
commit 0586e49726

View file

@ -1257,6 +1257,8 @@ _do_convert_draw (GstGLContext * context, GstGLColorConvert * convert)
guint out_width, out_height;
gint i;
GLint viewport_dim[4];
const GLfloat vVertices[] = { 1.0f, -1.0f, 0.0f,
1.0f, 0.0f,
-1.0f, -1.0f, 0.0f,
@ -1303,6 +1305,8 @@ _do_convert_draw (GstGLContext * context, GstGLColorConvert * convert)
else if (gl->DrawBuffer)
gl->DrawBuffer (GL_COLOR_ATTACHMENT0);
gl->GetIntegerv (GL_VIEWPORT, viewport_dim);
gl->Viewport (0, 0, out_width, out_height);
gl->ClearColor (0.0, 0.0, 0.0, 0.0);
@ -1344,6 +1348,9 @@ _do_convert_draw (GstGLContext * context, GstGLColorConvert * convert)
/* we are done with the shader */
gst_gl_context_clear_shader (context);
gl->Viewport (viewport_dim[0], viewport_dim[1], viewport_dim[2],
viewport_dim[3]);
gst_gl_context_check_framebuffer_status (context);
gl->BindFramebuffer (GL_FRAMEBUFFER, 0);