From fd038dc53ab42afb6a0160906cb8004930363d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 26 Mar 2013 15:41:58 +0100 Subject: Make QGLPaintEngine work on retina displays. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Gunnar Sletta --- src/opengl/qglpaintdevice.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/opengl') 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 #include #include +#include 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 -- cgit v1.2.3