Cocoa Port:

- Enable Retina displays to draw video frames at their native resolution. (Tested on the iMac 5K Retina and MacBook Pro Retina.)
This commit is contained in:
rogerman 2015-07-08 06:49:37 +00:00
parent a8ffd1e40c
commit 04cbc13a6d
2 changed files with 28 additions and 2 deletions

View File

@ -1269,6 +1269,13 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
return self;
}
#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
if ([self respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)])
{
[self setWantsBestResolutionOpenGLSurface:YES];
}
#endif
inputManager = nil;
// Initialize the OpenGL context
@ -1658,7 +1665,13 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
{
[context update];
DisplayWindowController *windowController = (DisplayWindowController *)[[self window] delegate];
[CocoaDSUtil messageSendOneWayWithRect:[[windowController cdsVideoOutput] receivePort] msgID:MESSAGE_RESIZE_VIEW rect:rect];
#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
const NSRect newViewportRect = [self convertRectToBacking:rect];
#else
const NSRect newViewportRect = rect;
#endif
[CocoaDSUtil messageSendOneWayWithRect:[[windowController cdsVideoOutput] receivePort] msgID:MESSAGE_RESIZE_VIEW rect:newViewportRect];
}
}

View File

@ -50,6 +50,13 @@
return self;
}
#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
if ([self respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)])
{
[self setWantsBestResolutionOpenGLSurface:YES];
}
#endif
isPreviewImageLoaded = false;
// Initialize the OpenGL context
@ -90,8 +97,14 @@
CGLContextObj prevContext = CGLGetCurrentContext();
CGLSetCurrentContext(cglDisplayContext);
#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
const NSRect newViewportRect = [self convertRectToBacking:frameRect];
#else
const NSRect newViewportRect = frameRect;
#endif
OGLInfo *oglInfo = OGLInfoCreate_Func();
oglImage = new OGLImage(oglInfo, 64, 64, frameRect.size.width, frameRect.size.height);
oglImage = new OGLImage(oglInfo, 64, 64, newViewportRect.size.width, newViewportRect.size.height);
oglImage->SetFiltersPreferGPUOGL(true);
oglImage->SetSourceDeposterize(false);
oglImage->SetOutputFilterOGL(OutputFilterTypeID_Bilinear);