diff options
author | Liang Qi <liang.qi@qt.io> | 2018-06-07 19:10:53 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-06-07 19:10:53 +0200 |
commit | 096e37910d93f9c52976600e985c615ea36fe291 (patch) | |
tree | 713d020f4a04f03d8ca6e111055e7eebe85953a8 /src/gui/opengl | |
parent | 88eda007a3b5046999dd0b287634765efcd8934d (diff) | |
parent | a14a943f9ac3d1e85514d7fb6688c84e624ac850 (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')
-rw-r--r-- | src/gui/opengl/qopenglframebufferobject.cpp | 7 | ||||
-rw-r--r-- | src/gui/opengl/qopengltexturehelper.cpp | 6 |
2 files changed, 11 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); } diff --git a/src/gui/opengl/qopengltexturehelper.cpp b/src/gui/opengl/qopengltexturehelper.cpp index be88946e90..6709edc4e2 100644 --- a/src/gui/opengl/qopengltexturehelper.cpp +++ b/src/gui/opengl/qopengltexturehelper.cpp @@ -188,6 +188,12 @@ QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context) TexBufferRange = 0; TextureView = 0; + // OpenGL ES 3.1+ has TexStorage2DMultisample + if (ctx->format().version() >= qMakePair(3, 1)) { + QOpenGLExtraFunctionsPrivate *extra = static_cast<QOpenGLExtensions *>(context->extraFunctions())->d(); + TexStorage2DMultisample = extra->f.TexStorage2DMultisample; + } + #endif if (context->isOpenGLES() && context->hasExtension(QByteArrayLiteral("GL_OES_texture_3D"))) { |