summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2013-03-26 15:41:58 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-15 10:28:00 +0200
commitfd038dc53ab42afb6a0160906cb8004930363d83 (patch)
tree18096814eeeb5fe0557d15cf54605984cd1c24d8 /src
parentcea58f4b77e1639e5671cf424544d4948fb8e9ef (diff)
Make QGLPaintEngine work on retina displays.
QGLWidgetGLPaintDevice::size now returns the size in device pixels. This fixes the QPainter "overpainting" and GraphicsView with a QGLWidget viewport use cases. Task-number: QTBUG-30217 Change-Id: I01998d39d7b4d755cf8b7b3fab5f75cd0d899ccf Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qglpaintdevice.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp
index ef9bdba070..6a8d5c042e 100644
--- a/src/opengl/qglpaintdevice.cpp
+++ b/src/opengl/qglpaintdevice.cpp
@@ -44,6 +44,7 @@
#include <private/qglpixelbuffer_p.h>
#include <private/qglframebufferobject_p.h>
#include <qopenglfunctions.h>
+#include <qwindow.h>
QT_BEGIN_NAMESPACE
@@ -188,7 +189,12 @@ void QGLWidgetGLPaintDevice::endPaint()
QSize QGLWidgetGLPaintDevice::size() const
{
+#ifdef Q_OS_MAC
+ return glWidget->size() * (glWidget->windowHandle() ?
+ glWidget->windowHandle()->devicePixelRatio() : qApp->devicePixelRatio());
+#else
return glWidget->size();
+#endif
}
QGLContext* QGLWidgetGLPaintDevice::context() const