summaryrefslogtreecommitdiffstats
path: root/src/openglwidgets
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2020-09-01 13:45:24 +0200
committerMorten Johan Sørvig <morten.sorvig@qt.io>2020-09-10 17:28:11 +0200
commitb3c991ae8f9da6d8eb26f10b3d4ab08587588c9e (patch)
tree8f2ff32cadf9b8733701b8f99229a6135f53f7d7 /src/openglwidgets
parente1ce78d48498a3de21fe4714e92e2c0fcf1a0813 (diff)
Port from devicePixelRatioF() to devicePixelRatio()
This ports all of QtBase. Change-Id: If6712da44d7749b97b74f4614a04fac360f69d9e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/openglwidgets')
-rw-r--r--src/openglwidgets/qopenglwidget.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/openglwidgets/qopenglwidget.cpp b/src/openglwidgets/qopenglwidget.cpp
index cb60de1fd1..c47df876dd 100644
--- a/src/openglwidgets/qopenglwidget.cpp
+++ b/src/openglwidgets/qopenglwidget.cpp
@@ -695,7 +695,7 @@ void QOpenGLWidgetPrivate::recreateFbo()
if (textureFormat)
format.setInternalTextureFormat(textureFormat);
- const QSize deviceSize = q->size() * q->devicePixelRatioF();
+ const QSize deviceSize = q->size() * q->devicePixelRatio();
fbo = new QOpenGLFramebufferObject(deviceSize, format);
if (samples > 0)
resolvedFbo = new QOpenGLFramebufferObject(deviceSize);
@@ -707,7 +707,7 @@ void QOpenGLWidgetPrivate::recreateFbo()
flushPending = true; // Make sure the FBO is initialized before use
paintDevice->setSize(deviceSize);
- paintDevice->setDevicePixelRatio(q->devicePixelRatioF());
+ paintDevice->setDevicePixelRatio(q->devicePixelRatio());
emit q->resized();
}
@@ -794,8 +794,8 @@ void QOpenGLWidgetPrivate::initialize()
}
paintDevice = new QOpenGLWidgetPaintDevice(q);
- paintDevice->setSize(q->size() * q->devicePixelRatioF());
- paintDevice->setDevicePixelRatio(q->devicePixelRatioF());
+ paintDevice->setSize(q->size() * q->devicePixelRatio());
+ paintDevice->setDevicePixelRatio(q->devicePixelRatio());
context = ctx.take();
initialized = true;
@@ -824,7 +824,7 @@ void QOpenGLWidgetPrivate::invokeUserPaint()
QOpenGLFunctions *f = ctx->functions();
QOpenGLContextPrivate::get(ctx)->defaultFboRedirect = fbo->handle();
- f->glViewport(0, 0, q->width() * q->devicePixelRatioF(), q->height() * q->devicePixelRatioF());
+ f->glViewport(0, 0, q->width() * q->devicePixelRatio(), q->height() * q->devicePixelRatio());
inPaintGL = true;
q->paintGL();
inPaintGL = false;
@@ -898,8 +898,8 @@ QImage QOpenGLWidgetPrivate::grabFramebuffer()
}
const bool hasAlpha = q->format().hasAlpha();
- QImage res = qt_gl_read_framebuffer(q->size() * q->devicePixelRatioF(), hasAlpha, hasAlpha);
- res.setDevicePixelRatio(q->devicePixelRatioF());
+ QImage res = qt_gl_read_framebuffer(q->size() * q->devicePixelRatio(), hasAlpha, hasAlpha);
+ res.setDevicePixelRatio(q->devicePixelRatio());
// While we give no guarantees of what is going to be left bound, prefer the
// multisample fbo instead of the resolved one. Clients may continue to
@@ -924,7 +924,7 @@ void QOpenGLWidgetPrivate::resizeViewportFramebuffer()
if (!initialized)
return;
- if (!fbo || q->size() * q->devicePixelRatioF() != fbo->size()) {
+ if (!fbo || q->size() * q->devicePixelRatio() != fbo->size()) {
recreateFbo();
q->update();
}
@@ -1403,7 +1403,7 @@ bool QOpenGLWidget::event(QEvent *e)
}
break;
case QEvent::ScreenChangeInternal:
- if (d->initialized && d->paintDevice->devicePixelRatioF() != devicePixelRatioF())
+ if (d->initialized && d->paintDevice->devicePixelRatio() != devicePixelRatio())
d->recreateFbo();
break;
default: