From 2f18791a437fcd800b3457bdb51421707d81cb9d Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Wed, 2 Dec 2015 23:09:38 +0100 Subject: [PATCH] LP-29 don't take device pixel ratio into account --- ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.cpp b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.cpp index 3f81a065b..8fb3038fd 100644 --- a/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.cpp +++ b/ground/gcs/src/libs/osgearth/osgQtQuick/OSGViewport.cpp @@ -531,7 +531,12 @@ public: QOpenGLFramebufferObjectFormat format; format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); // format.setSamples(4); - int dpr = h->self->window()->devicePixelRatio(); + + // Keeping this for reference : + // Mac need(ed) to have devicePixelRatio (dpr) taken into account (i.e. dpr = 2). + // Further tests on Mac have shown that although dpr is still 2 it should not be used to scale the fbo. + // Note that getting the window to get the devicePixelRatio is not great (messing with windows is often a bad idea...) + int dpr = 1; // h->self->window()->devicePixelRatio(); QOpenGLFramebufferObject *fbo = new QOpenGLFramebufferObject(size.width() / dpr, size.height() / dpr, format); return fbo;