Commit 3ffa0a33 authored by Felix Paul Kühne's avatar Felix Paul Kühne

caopengllayer: use visible rect instead of layer bounds to determine the current output size

parent f938a451
...@@ -306,7 +306,7 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -306,7 +306,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
/* we always use our current frame here */ /* we always use our current frame here */
vout_display_cfg_t cfg_tmp = *cfg; vout_display_cfg_t cfg_tmp = *cfg;
[CATransaction lock]; [CATransaction lock];
CGRect bounds = [sys->cgLayer bounds]; CGRect bounds = [sys->cgLayer visibleRect];
[CATransaction unlock]; [CATransaction unlock];
cfg_tmp.display.width = bounds.size.width; cfg_tmp.display.width = bounds.size.width;
cfg_tmp.display.height = bounds.size.height; cfg_tmp.display.height = bounds.size.height;
...@@ -395,7 +395,8 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name) ...@@ -395,7 +395,8 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
self = [super init]; self = [super init];
if (self) { if (self) {
[CATransaction lock]; [CATransaction lock];
[self setAutoresizingMask: kCALayerWidthSizable | kCALayerHeightSizable]; self.needsDisplayOnBoundsChange = YES;
self.autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable;
self.asynchronous = NO; self.asynchronous = NO;
[CATransaction unlock]; [CATransaction unlock];
} }
...@@ -412,7 +413,8 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name) ...@@ -412,7 +413,8 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
{ {
[super resizeWithOldSuperlayerSize: size]; [super resizeWithOldSuperlayerSize: size];
CGSize boundsSize = self.bounds.size; CGSize boundsSize = self.visibleRect.size;
if (_vd) if (_vd)
vout_display_SendEventDisplaySize(_vd, boundsSize.width, boundsSize.height); vout_display_SendEventDisplaySize(_vd, boundsSize.width, boundsSize.height);
} }
...@@ -435,7 +437,8 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name) ...@@ -435,7 +437,8 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
if (!sys->vgl) if (!sys->vgl)
return; return;
CGRect bounds = [self bounds]; CGRect bounds = [self visibleRect];
// x / y are top left corner, but we need the lower left one // x / y are top left corner, but we need the lower left one
glViewport (sys->place.x, bounds.size.height - (sys->place.y + sys->place.height), sys->place.width, sys->place.height); glViewport (sys->place.x, bounds.size.height - (sys->place.y + sys->place.height), sys->place.width, sys->place.height);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment