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
parent
cea58f4b77
commit
fd038dc53a
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue