summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglframebufferobject.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-06-07 19:10:53 +0200
committerLiang Qi <liang.qi@qt.io>2018-06-07 19:10:53 +0200
commit096e37910d93f9c52976600e985c615ea36fe291 (patch)
tree713d020f4a04f03d8ca6e111055e7eebe85953a8 /src/gui/opengl/qopenglframebufferobject.cpp
parent88eda007a3b5046999dd0b287634765efcd8934d (diff)
parenta14a943f9ac3d1e85514d7fb6688c84e624ac850 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts: .qmake.conf src/corelib/kernel/qeventdispatcher_cf.mm src/gui/kernel/qguiapplication_p.h src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/qioseventdispatcher.mm src/plugins/platforms/windows/qwindowsdrag.h src/plugins/platforms/windows/qwindowsinternalmimedata.h src/plugins/platforms/windows/qwindowsmime.cpp src/plugins/platforms/winrt/qwinrtscreen.cpp Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
Diffstat (limited to 'src/gui/opengl/qopenglframebufferobject.cpp')
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index 469f019a1c..91c25184b6 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -1424,14 +1424,17 @@ QImage QOpenGLFramebufferObject::toImage(bool flipped, int colorAttachmentIndex)
// qt_gl_read_framebuffer doesn't work on a multisample FBO
if (format().samples() != 0) {
QRect rect(QPoint(0, 0), size());
+ QOpenGLFramebufferObjectFormat fmt;
if (extraFuncs->hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets)) {
- QOpenGLFramebufferObject temp(d->colorAttachments[colorAttachmentIndex].size, QOpenGLFramebufferObjectFormat());
+ fmt.setInternalTextureFormat(d->colorAttachments[colorAttachmentIndex].internalFormat);
+ QOpenGLFramebufferObject temp(d->colorAttachments[colorAttachmentIndex].size, fmt);
blitFramebuffer(&temp, rect, const_cast<QOpenGLFramebufferObject *>(this), rect,
GL_COLOR_BUFFER_BIT, GL_NEAREST,
colorAttachmentIndex, 0);
image = temp.toImage(flipped);
} else {
- QOpenGLFramebufferObject temp(size(), QOpenGLFramebufferObjectFormat());
+ fmt.setInternalTextureFormat(d->colorAttachments[0].internalFormat);
+ QOpenGLFramebufferObject temp(size(), fmt);
blitFramebuffer(&temp, rect, const_cast<QOpenGLFramebufferObject *>(this), rect);
image = temp.toImage(flipped);
}