summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-10-01 16:04:36 +0300
committerSebastian Dröge <sebastian@centricular.com>2014-10-14 10:01:31 +0200
commitb183e3e5f778840546deac7c16c8291c376ea693 (patch)
treeb747ebcd2706c79cedec3b0d49506818c49dcb0a /gst-libs
parent5279342396d426c6d30bf833173ee373fe95ca49 (diff)
downloadgstreamer-plugins-bad-b183e3e5f778840546deac7c16c8291c376ea693.tar.gz
gl/cocoa: Always update our viewport if Cocoa tells us something has changed
The visible rect and bounds might be the same as before, but Cocoa might've changed our viewport without us nothing. This happens if you hide the view and show it again.
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m25
1 files changed, 8 insertions, 17 deletions
diff --git a/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m b/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m
index cc88160cb..339c59327 100644
--- a/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m
+++ b/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m
@@ -85,7 +85,6 @@ struct _GstGLWindowCocoaPrivate
GMainLoop *loop;
GLint viewport_dim[4];
- NSRect bounds, visibleRect;
};
static void
@@ -524,25 +523,17 @@ resize_cb (gpointer data)
[glContext update];
- if (window_cocoa->priv->bounds.size.width != resize_data->bounds.size.width ||
- window_cocoa->priv->bounds.size.height != resize_data->bounds.size.height ||
- window_cocoa->priv->visibleRect.origin.x != resize_data->visibleRect.origin.x ||
- window_cocoa->priv->visibleRect.origin.y != resize_data->visibleRect.origin.y) {
- gl = context->gl_vtable;
-
- if (window->resize) {
- window->resize (window->resize_data, resize_data->bounds.size.width, resize_data->bounds.size.height);
- gl->GetIntegerv (GL_VIEWPORT, window_cocoa->priv->viewport_dim);
- }
+ gl = context->gl_vtable;
- gl->Viewport (window_cocoa->priv->viewport_dim[0] - resize_data->visibleRect.origin.x,
- window_cocoa->priv->viewport_dim[1] - resize_data->visibleRect.origin.y,
- window_cocoa->priv->viewport_dim[2], window_cocoa->priv->viewport_dim[3]);
-
- window_cocoa->priv->visibleRect = resize_data->visibleRect;
- window_cocoa->priv->bounds = resize_data->bounds;
+ if (window->resize) {
+ window->resize (window->resize_data, resize_data->bounds.size.width, resize_data->bounds.size.height);
+ gl->GetIntegerv (GL_VIEWPORT, window_cocoa->priv->viewport_dim);
}
+ gl->Viewport (window_cocoa->priv->viewport_dim[0] - resize_data->visibleRect.origin.x,
+ window_cocoa->priv->viewport_dim[1] - resize_data->visibleRect.origin.y,
+ window_cocoa->priv->viewport_dim[2], window_cocoa->priv->viewport_dim[3]);
+
GST_GL_WINDOW (window_cocoa)->draw (GST_GL_WINDOW (window_cocoa)->draw_data);
[glContext flushBuffer];
}