qt_openglrenderer: fix fullscreen rendering on mac
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user