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>
bb10
Morten Johan Sørvig 2013-03-26 15:41:58 +01:00 committed by The Qt Project
parent cea58f4b77
commit fd038dc53a
1 changed files with 6 additions and 0 deletions

View File

@ -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