gl/viv-fb: fix wrong pos (x,y) calculate in queue_resize

queue_resize viewport coordinate calculate is wrong and
force queue_resize when do _set_render_rectangle in case
user input pos changed

https://bugzilla.gnome.org/show_bug.cgi?id=787394
This commit is contained in:
Haihua Hu 2017-09-11 15:12:53 +08:00 committed by Tim-Philipp Müller
parent 4fa5c37878
commit 8ef4a7ddaf

View file

@ -179,9 +179,7 @@ draw_cb (gpointer data)
gl->GetIntegerv (GL_VIEWPORT, viewport_dim);
viewport_dim[0] += window_egl->render_rectangle.x;
viewport_dim[1] -= window_egl->render_rectangle.y;
viewport_dim[2] -= window_egl->render_rectangle.x;
viewport_dim[3] -= window_egl->render_rectangle.y;
viewport_dim[1] += window_egl->render_rectangle.y;
gl->Viewport (viewport_dim[0],
viewport_dim[1], viewport_dim[2], viewport_dim[3]);
}
@ -220,13 +218,15 @@ static void
_set_render_rectangle (gpointer data)
{
SetRenderRectangleData *render = data;
GstGLWindow *window = GST_GL_WINDOW (render->window_egl);
GST_LOG_OBJECT (render->window_egl, "setting render rectangle %i,%i+%ix%i",
render->rect.x, render->rect.y, render->rect.w, render->rect.h);
render->window_egl->render_rectangle = render->rect;
gst_gl_window_resize (GST_GL_WINDOW (render->window_egl), render->rect.w,
render->rect.h);
gst_gl_window_resize (window, render->rect.w, render->rect.h);
window->queue_resize = TRUE;
}
static gboolean