diff options
Diffstat (limited to 'src/quick/scenegraph')
20 files changed, 40 insertions, 36 deletions
diff --git a/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture.cpp b/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture.cpp index b59d490250..45d7a65555 100644 --- a/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture.cpp +++ b/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture.cpp @@ -136,12 +136,12 @@ Texture::Texture(Atlas *atlas, const QRect &textureRect, const QByteArray &data, { float w = atlas->size().width(); float h = atlas->size().height(); - QRect nopad = atlasSubRect(); + const QRect &r = atlasSubRect(); // offset by half-pixel to prevent bleeding when scaling - m_texture_coords_rect = QRectF((nopad.x() + .5) / w, - (nopad.y() + .5) / h, - (nopad.width() - 1.) / w, - (nopad.height() - 1.) / h); + m_texture_coords_rect = QRectF((r.x() + .5) / w, + (r.y() + .5) / h, + (size.width() - 1.) / w, + (size.height() - 1.) / h); } Texture::~Texture() @@ -151,7 +151,7 @@ Texture::~Texture() bool Texture::hasAlphaChannel() const { - return QSGCompressedTexture::formatIsOpaque(static_cast<Atlas*>(m_atlas)->format()); + return !QSGCompressedTexture::formatIsOpaque(static_cast<Atlas*>(m_atlas)->format()); } QSGTexture *Texture::removedFromAtlas() const diff --git a/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture_p.h b/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture_p.h index 78051778f5..aec7dbf976 100644 --- a/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture_p.h +++ b/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture_p.h @@ -53,7 +53,7 @@ #include <QtCore/QSize> -#include <QtGui/qopengl.h> +#include <qopengl.h> #include <QtQuick/QSGTexture> #include <QtQuick/private/qsgareaallocator_p.h> diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 5310e76dae..f9e6ba03a8 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -138,6 +138,7 @@ struct QMatrix4x4_Accessor static bool isScale(const QMatrix4x4 &m) { return ((const QMatrix4x4_Accessor &) m).flagBits <= 0x2; } static bool is2DSafe(const QMatrix4x4 &m) { return ((const QMatrix4x4_Accessor &) m).flagBits < 0x8; } }; +Q_STATIC_ASSERT(sizeof(QMatrix4x4_Accessor) == sizeof(QMatrix4x4)); const float OPAQUE_LIMIT = 0.999f; @@ -480,8 +481,6 @@ Updater::Updater(Renderer *r) m_roots.add(0); m_combined_matrix_stack.add(&m_identityMatrix); m_rootMatrices.add(m_identityMatrix); - - Q_ASSERT(sizeof(QMatrix4x4_Accessor) == sizeof(QMatrix4x4)); } void Updater::updateStates(QSGNode *n) diff --git a/src/quick/scenegraph/coreapi/qsggeometry.h b/src/quick/scenegraph/coreapi/qsggeometry.h index d17915a842..9c60876597 100644 --- a/src/quick/scenegraph/coreapi/qsggeometry.h +++ b/src/quick/scenegraph/coreapi/qsggeometry.h @@ -41,7 +41,7 @@ #define QSGGEOMETRY_H #include <QtQuick/qtquickglobal.h> -#include <QtGui/qopengl.h> +#include <qopengl.h> #include <QtCore/QRectF> QT_BEGIN_NAMESPACE diff --git a/src/quick/scenegraph/coreapi/qsgmaterialshader.cpp b/src/quick/scenegraph/coreapi/qsgmaterialshader.cpp index d614f9be4c..9049dd5826 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterialshader.cpp +++ b/src/quick/scenegraph/coreapi/qsgmaterialshader.cpp @@ -44,8 +44,8 @@ # include <private/qsgshadersourcebuilder_p.h> # include <private/qsgdefaultcontext_p.h> # include <private/qsgdefaultrendercontext_p.h> -# include <QtGui/QOpenGLFunctions> -# include <QtGui/QOpenGLContext> +# include <QOpenGLFunctions> +# include <QOpenGLContext> #endif QT_BEGIN_NAMESPACE diff --git a/src/quick/scenegraph/coreapi/qsgmaterialshader.h b/src/quick/scenegraph/coreapi/qsgmaterialshader.h index d7ee23384f..6783b3f890 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterialshader.h +++ b/src/quick/scenegraph/coreapi/qsgmaterialshader.h @@ -42,7 +42,7 @@ #include <QtQuick/qtquickglobal.h> #if QT_CONFIG(opengl) -# include <QtGui/qopenglshaderprogram.h> +# include <qopenglshaderprogram.h> #endif #include <QtGui/QMatrix4x4> #include <QtCore/QRect> diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp index 90090e1cc0..cd16014d41 100644 --- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp @@ -40,9 +40,9 @@ #include "qsgrenderer_p.h" #include "qsgnodeupdater_p.h" #if QT_CONFIG(opengl) -# include <QtGui/QOpenGLFramebufferObject> -# include <QtGui/QOpenGLContext> -# include <QtGui/QOpenGLFunctions> +# include <QOpenGLFramebufferObject> +# include <QOpenGLContext> +# include <QOpenGLFunctions> #endif #include <private/qquickprofiler_p.h> #include <qtquick_tracepoints_p.h> diff --git a/src/quick/scenegraph/coreapi/qsgtexture.cpp b/src/quick/scenegraph/coreapi/qsgtexture.cpp index 715633fdba..486fe50190 100644 --- a/src/quick/scenegraph/coreapi/qsgtexture.cpp +++ b/src/quick/scenegraph/coreapi/qsgtexture.cpp @@ -39,8 +39,8 @@ #include "qsgtexture_p.h" #if QT_CONFIG(opengl) -# include <QtGui/qopenglcontext.h> -# include <QtGui/qopenglfunctions.h> +# include <qopenglcontext.h> +# include <qopenglfunctions.h> #endif #include <private/qqmlglobal_p.h> #include <private/qsgmaterialshader_p.h> diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp index eab0369be7..e0d9d5db68 100644 --- a/src/quick/scenegraph/qsgadaptationlayer.cpp +++ b/src/quick/scenegraph/qsgadaptationlayer.cpp @@ -329,7 +329,7 @@ void QSGDistanceFieldGlyphCache::updateRhiTexture(QRhiTexture *oldTex, QRhiTextu } #if defined(QSG_DISTANCEFIELD_CACHE_DEBUG) -#include <QtGui/qopenglfunctions.h> +#include <qopenglfunctions.h> void QSGDistanceFieldGlyphCache::saveTexture(GLuint textureId, int width, int height) const { diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.h b/src/quick/scenegraph/qsgdefaultglyphnode_p.h index 4cff2d3d24..f70d51d1ee 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.h +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.h @@ -53,7 +53,6 @@ #include <private/qsgadaptationlayer_p.h> #include <private/qsgbasicglyphnode_p.h> -#include <qlinkedlist.h> QT_BEGIN_NAMESPACE diff --git a/src/quick/scenegraph/qsgdefaultinternalimagenode.cpp b/src/quick/scenegraph/qsgdefaultinternalimagenode.cpp index 500d4e6e95..167d2b01dd 100644 --- a/src/quick/scenegraph/qsgdefaultinternalimagenode.cpp +++ b/src/quick/scenegraph/qsgdefaultinternalimagenode.cpp @@ -41,7 +41,7 @@ #include <private/qsgdefaultrendercontext_p.h> #include <private/qsgmaterialshader_p.h> #include <private/qsgtexturematerial_p.h> -#include <QtGui/qopenglfunctions.h> +#include <qopenglfunctions.h> #include <QtCore/qmath.h> #include <QtGui/private/qrhi_p.h> diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp index e8e9f76d04..a25daa6070 100644 --- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp @@ -39,7 +39,7 @@ #include "qsgdistancefieldglyphnode_p_p.h" #include "qsgrhidistancefieldglyphcache_p.h" -#include <QtGui/qopenglfunctions.h> +#include <qopenglfunctions.h> #include <QtGui/qsurface.h> #include <QtGui/qwindow.h> #include <qmath.h> diff --git a/src/quick/scenegraph/qsgopengldistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgopengldistancefieldglyphcache.cpp index fc8ec25053..2f9b1e4ce6 100644 --- a/src/quick/scenegraph/qsgopengldistancefieldglyphcache.cpp +++ b/src/quick/scenegraph/qsgopengldistancefieldglyphcache.cpp @@ -54,7 +54,7 @@ #if !defined(QT_OPENGL_ES_2) -#include <QtGui/qopenglfunctions_3_2_core.h> +#include <qopenglfunctions_3_2_core.h> #endif QT_BEGIN_NAMESPACE diff --git a/src/quick/scenegraph/qsgopengldistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgopengldistancefieldglyphcache_p.h index e78e735b6f..2e7b5baae2 100644 --- a/src/quick/scenegraph/qsgopengldistancefieldglyphcache_p.h +++ b/src/quick/scenegraph/qsgopengldistancefieldglyphcache_p.h @@ -52,7 +52,7 @@ // #include "qsgadaptationlayer_p.h" -#include <QtGui/qopenglfunctions.h> +#include <qopenglfunctions.h> #include <qopenglshaderprogram.h> #include <qopenglbuffer.h> #include <qopenglvertexarrayobject.h> diff --git a/src/quick/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp index 9194d3e730..cf30cb3f9a 100644 --- a/src/quick/scenegraph/qsgrhisupport.cpp +++ b/src/quick/scenegraph/qsgrhisupport.cpp @@ -157,6 +157,8 @@ void QSGRhiSupport::applySettings() } else if (rhiBackend == QByteArrayLiteral("null")) { m_rhiBackend = QRhi::Null; } else { + if (!rhiBackend.isEmpty()) + qWarning("Unknown key \"%s\" for QSG_RHI_BACKEND, falling back to default backend.", qPrintable(rhiBackend)); #if defined(Q_OS_WIN) m_rhiBackend = QRhi::D3D11; #elif defined(Q_OS_MACOS) || defined(Q_OS_IOS) diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 4777f46f0a..9b288029b4 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -660,6 +660,11 @@ void QSGRenderThread::sync(bool inExpose, bool inGrab) qCDebug(QSG_LOG_RENDERLOOP, QSG_RT_PAD, "- window has bad size, sync aborted"); } + // Two special cases: For grabs we do not care about blocking the gui + // (main) thread. When this is from an expose, we will keep locked until + // the frame is rendered (submitted), so in that case waking happens later + // in syncAndRender(). Otherwise, wake now and let the main thread go on + // while we render. if (!inExpose && !inGrab) { qCDebug(QSG_LOG_RENDERLOOP, QSG_RT_PAD, "- sync complete, waking Gui"); waitCondition.wakeOne(); @@ -756,13 +761,11 @@ void QSGRenderThread::syncAndRender(QImage *grabImage) QCoreApplication::postEvent(window, new QEvent(QEvent::Type(QQuickWindowPrivate::FullUpdateRequest))); // Before returning we need to ensure the same wake up logic that // would have happened if beginFrame() had suceeded. - if (exposeRequested) { + if (syncRequested && !grabRequested) { + // Lock like sync() would do. Note that exposeRequested always includes syncRequested. qCDebug(QSG_LOG_RENDERLOOP, QSG_RT_PAD, "- bailing out due to failed beginFrame, wake Gui"); - waitCondition.wakeOne(); - mutex.unlock(); - } else if (syncRequested && !grabRequested) { - qCDebug(QSG_LOG_RENDERLOOP, QSG_RT_PAD, "- bailing out due to failed beginFrame, wake Gui like sync would do"); mutex.lock(); + // Go ahead with waking because we will return right after this. waitCondition.wakeOne(); mutex.unlock(); } @@ -885,7 +888,8 @@ void QSGRenderThread::syncAndRender(QImage *grabImage) // has started rendering with a bad window, causing makeCurrent to // fail or if the window has a bad size. if (exposeRequested) { - qCDebug(QSG_LOG_RENDERLOOP, QSG_RT_PAD, "- wake Gui after initial expose"); + // With expose sync() did not wake gui, do it now. + qCDebug(QSG_LOG_RENDERLOOP, QSG_RT_PAD, "- wake Gui after expose"); waitCondition.wakeOne(); mutex.unlock(); } diff --git a/src/quick/scenegraph/util/qsgengine.cpp b/src/quick/scenegraph/util/qsgengine.cpp index 4880d98871..13c97e8615 100644 --- a/src/quick/scenegraph/util/qsgengine.cpp +++ b/src/quick/scenegraph/util/qsgengine.cpp @@ -45,7 +45,7 @@ #include <private/qsgplaintexture_p.h> #if QT_CONFIG(opengl) -# include <QtGui/QOpenGLContext> +# include <QOpenGLContext> # include <private/qsgdefaultrendercontext_p.h> #endif diff --git a/src/quick/scenegraph/util/qsgopenglatlastexture_p.h b/src/quick/scenegraph/util/qsgopenglatlastexture_p.h index f8dd7cdf02..379c4c7fff 100644 --- a/src/quick/scenegraph/util/qsgopenglatlastexture_p.h +++ b/src/quick/scenegraph/util/qsgopenglatlastexture_p.h @@ -53,7 +53,7 @@ #include <QtCore/QSize> -#include <QtGui/qopengl.h> +#include <qopengl.h> #include <QtQuick/QSGTexture> #include <QtQuick/private/qsgplaintexture_p.h> diff --git a/src/quick/scenegraph/util/qsgshadersourcebuilder.cpp b/src/quick/scenegraph/util/qsgshadersourcebuilder.cpp index 93fc213f2e..77fded6c21 100644 --- a/src/quick/scenegraph/util/qsgshadersourcebuilder.cpp +++ b/src/quick/scenegraph/util/qsgshadersourcebuilder.cpp @@ -39,8 +39,8 @@ #include "qsgshadersourcebuilder_p.h" -#include <QtGui/qopenglcontext.h> -#include <QtGui/qopenglshaderprogram.h> +#include <qopenglcontext.h> +#include <qopenglshaderprogram.h> #include <QtCore/qdebug.h> #include <QtCore/qfile.h> diff --git a/src/quick/scenegraph/util/qsgtexturematerial.cpp b/src/quick/scenegraph/util/qsgtexturematerial.cpp index 67b8748119..b4ac0c4d1d 100644 --- a/src/quick/scenegraph/util/qsgtexturematerial.cpp +++ b/src/quick/scenegraph/util/qsgtexturematerial.cpp @@ -40,8 +40,8 @@ #include "qsgtexturematerial_p.h" #include <private/qsgtexture_p.h> #if QT_CONFIG(opengl) -# include <QtGui/qopenglshaderprogram.h> -# include <QtGui/qopenglfunctions.h> +# include <qopenglshaderprogram.h> +# include <qopenglfunctions.h> #endif #include <QtGui/private/qrhi_p.h> |