Cocoa Port: Fix a longstanding bug where OpenGL video blitter would fail to render to window correctly on Retina displays.
This commit is contained in:
parent
cfa75df069
commit
88f2dfdb53
|
@ -6516,7 +6516,7 @@ void OGLHUDLayer::RenderOGL(bool isRenderingFlipped)
|
||||||
|
|
||||||
if (this->_needUpdateViewport)
|
if (this->_needUpdateViewport)
|
||||||
{
|
{
|
||||||
glUniform2f(this->_uniformViewSize, this->_output->GetPresenterProperties().clientWidth, this->_output->GetPresenterProperties().clientHeight);
|
glUniform2f(this->_uniformViewSize, this->_output->GetViewportWidth(), this->_output->GetViewportHeight());
|
||||||
glUniform1i(this->_uniformRenderFlipped, (isRenderingFlipped) ? GL_TRUE : GL_FALSE);
|
glUniform1i(this->_uniformRenderFlipped, (isRenderingFlipped) ? GL_TRUE : GL_FALSE);
|
||||||
this->_needUpdateViewport = false;
|
this->_needUpdateViewport = false;
|
||||||
}
|
}
|
||||||
|
@ -6589,7 +6589,7 @@ void OGLHUDLayer::RenderOGL(bool isRenderingFlipped)
|
||||||
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
|
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
|
||||||
|
|
||||||
// Finally, draw each character inside the box.
|
// Finally, draw each character inside the box.
|
||||||
const GLfloat textBoxScale = (GLfloat)HUD_TEXTBOX_BASE_SCALE * this->_output->GetHUDObjectScale() / this->_output->GetScaleFactor();
|
const GLfloat textBoxScale = (GLfloat)HUD_TEXTBOX_BASE_SCALE * this->_output->GetHUDObjectScale();
|
||||||
if (textBoxScale >= (2.0/3.0))
|
if (textBoxScale >= (2.0/3.0))
|
||||||
{
|
{
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
|
|
|
@ -2101,6 +2101,13 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
|
||||||
|
|
||||||
localLayer = macOGLCDV->GetCALayer();
|
localLayer = macOGLCDV->GetCALayer();
|
||||||
|
|
||||||
|
#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
|
||||||
|
if ([[self window] respondsToSelector:@selector(backingScaleFactor)] && [localLayer respondsToSelector:@selector(setContentsScale:)])
|
||||||
|
{
|
||||||
|
[localLayer setContentsScale:[[self window] backingScaleFactor]];
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// For macOS 10.8 Mountain Lion and later, we can use the CAOpenGLLayer directly. But for
|
// For macOS 10.8 Mountain Lion and later, we can use the CAOpenGLLayer directly. But for
|
||||||
// earlier versions of macOS, using the CALayer directly will cause too many strange issues,
|
// earlier versions of macOS, using the CALayer directly will cause too many strange issues,
|
||||||
// so we'll just keep using the old-school NSOpenGLContext for these older macOS versions.
|
// so we'll just keep using the old-school NSOpenGLContext for these older macOS versions.
|
||||||
|
@ -2268,7 +2275,8 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
|
||||||
}
|
}
|
||||||
else if ([localLayer isKindOfClass:[CAOpenGLLayer class]])
|
else if ([localLayer isKindOfClass:[CAOpenGLLayer class]])
|
||||||
{
|
{
|
||||||
[localLayer setBounds:CGRectMake(0.0f, 0.0f, props.clientWidth, props.clientHeight)];
|
const double scaleFactor = [[self cdsVideoOutput] clientDisplay3DView]->Get3DPresenter()->GetScaleFactor();
|
||||||
|
[localLayer setBounds:CGRectMake(0.0f, 0.0f, props.clientWidth / scaleFactor, props.clientHeight / scaleFactor)];
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_APPLE_METAL
|
#ifdef ENABLE_APPLE_METAL
|
||||||
else if ([localLayer isKindOfClass:[CAMetalLayer class]])
|
else if ([localLayer isKindOfClass:[CAMetalLayer class]])
|
||||||
|
|
Loading…
Reference in New Issue