diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2013-05-21 18:22:27 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-23 12:49:39 +0200 |
commit | 004f25df78160d1caba2375fb2e6511a0c344bc8 (patch) | |
tree | 7d2bfd6054e38c5266a1b35f446cbde6e695c582 /src/opengl/qgl.cpp | |
parent | 602bd9873786ccadcb67da3036329f3122555cf8 (diff) |
QGLWidget: Support retina framebuffer grabbing
And update the opengl/grabber example.
Task-number: QTBUG-31173
Change-Id: If09f1f3634b353d034f51240fc68be6ee7aabb48
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r-- | src/opengl/qgl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index def0470622..72c6e035d9 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -4090,11 +4090,12 @@ QImage QGLWidget::grabFrameBuffer(bool withAlpha) { makeCurrent(); QImage res; - int w = width(); - int h = height(); + qreal pixelRatio = devicePixelRatio(); + int w = pixelRatio * width(); + int h = pixelRatio * height(); if (format().rgba()) res = qt_gl_read_frame_buffer(QSize(w, h), format().alpha(), withAlpha); - + res.setDevicePixelRatio(pixelRatio); return res; } |