qt_openglrenderer: fix fullscreen rendering on mac
This commit is contained in:
@@ -95,8 +95,8 @@ OpenGLRenderer::resizeEvent(QResizeEvent *event)
|
|||||||
context->makeCurrent(this);
|
context->makeCurrent(this);
|
||||||
|
|
||||||
glViewport(
|
glViewport(
|
||||||
destination.x(),
|
destination.x() * devicePixelRatio(),
|
||||||
destination.y(),
|
destination.y() * devicePixelRatio(),
|
||||||
destination.width() * devicePixelRatio(),
|
destination.width() * devicePixelRatio(),
|
||||||
destination.height() * devicePixelRatio());
|
destination.height() * devicePixelRatio());
|
||||||
}
|
}
|
||||||
@@ -179,8 +179,8 @@ OpenGLRenderer::initialize()
|
|||||||
glClearColor(0.f, 0.f, 0.f, 1.f);
|
glClearColor(0.f, 0.f, 0.f, 1.f);
|
||||||
|
|
||||||
glViewport(
|
glViewport(
|
||||||
destination.x(),
|
destination.x() * devicePixelRatio(),
|
||||||
destination.y(),
|
destination.y() * devicePixelRatio(),
|
||||||
destination.width() * devicePixelRatio(),
|
destination.width() * devicePixelRatio(),
|
||||||
destination.height() * devicePixelRatio());
|
destination.height() * devicePixelRatio());
|
||||||
|
|
||||||
@@ -425,6 +425,14 @@ OpenGLRenderer::onBlit(int buf_idx, int x, int y, int w, int h)
|
|||||||
|
|
||||||
context->makeCurrent(this);
|
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) {
|
if (source.width() != w || source.height() != h) {
|
||||||
source.setRect(0, 0, w, h);
|
source.setRect(0, 0, w, h);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user