Merge pull request #2581 from elyosh/fix-mac-opengl-fs

qt_openglrenderer: fix fullscreen rendering on mac
This commit is contained in:
Miran Grča
2022-08-06 23:55:34 +02:00
committed by GitHub

View File

@@ -95,8 +95,8 @@ OpenGLRenderer::resizeEvent(QResizeEvent *event)
context->makeCurrent(this);
glViewport(
destination.x(),
destination.y(),
destination.x() * devicePixelRatio(),
destination.y() * devicePixelRatio(),
destination.width() * devicePixelRatio(),
destination.height() * devicePixelRatio());
}
@@ -179,8 +179,8 @@ OpenGLRenderer::initialize()
glClearColor(0.f, 0.f, 0.f, 1.f);
glViewport(
destination.x(),
destination.y(),
destination.x() * devicePixelRatio(),
destination.y() * devicePixelRatio(),
destination.width() * devicePixelRatio(),
destination.height() * devicePixelRatio());
@@ -425,6 +425,14 @@ OpenGLRenderer::onBlit(int buf_idx, int x, int y, int w, int h)
context->makeCurrent(this);
#ifdef Q_OS_MACOS
glViewport(
destination.x() * devicePixelRatio(),
destination.y() * devicePixelRatio(),
destination.width() * devicePixelRatio(),
destination.height() * devicePixelRatio());
#endif
if (source.width() != w || source.height() != h) {
source.setRect(0, 0, w, h);