diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-11-21 13:10:02 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-11-22 10:27:21 +0100 |
commit | 744e77b841878fb017c0f2d60607090008f28180 (patch) | |
tree | ef0f95935b0d6bd589f1abfc19d637c1172a96d5 /src/quick/scenegraph | |
parent | 89fc75c667adc23036cbbdb4bf56251d7b988a6b (diff) |
Avoid initializing QFlags with 0 or nullptr
It is being deprecated.
Change-Id: I844bd92af85bc53a8fc0371408d05277bd49f511
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgmaterial.cpp | 1 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgmaterialrhishader.cpp | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgnode.cpp | 3 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgnode.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgrhivisualizer.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgcontextplugin.cpp | 1 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgrhilayer.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgrhisupport.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgplaintexture.cpp | 4 |
12 files changed, 11 insertions, 16 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 34027cbac7..a5f4a7e2ca 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -3257,7 +3257,7 @@ bool Renderer::ensurePipelineState(Element *e, const ShaderManager::Shader *sms) ps->setShaderResourceBindings(e->srb); ps->setRenderPassDescriptor(renderPassDescriptor()); - QRhiGraphicsPipeline::Flags flags = 0; + QRhiGraphicsPipeline::Flags flags; if (needsBlendConstant(m_gstate.srcColor) || needsBlendConstant(m_gstate.dstColor)) flags |= QRhiGraphicsPipeline::UsesBlendConstants; if (m_gstate.usesScissor) diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.cpp b/src/quick/scenegraph/coreapi/qsgmaterial.cpp index c8ae26311b..087c3c4cbf 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterial.cpp +++ b/src/quick/scenegraph/coreapi/qsgmaterial.cpp @@ -153,7 +153,6 @@ static void qt_print_material_count() */ QSGMaterial::QSGMaterial() - : m_flags(nullptr) { Q_UNUSED(m_reserved); #ifndef QT_NO_DEBUG diff --git a/src/quick/scenegraph/coreapi/qsgmaterialrhishader.cpp b/src/quick/scenegraph/coreapi/qsgmaterialrhishader.cpp index 77593591bd..c5cbd0c979 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterialrhishader.cpp +++ b/src/quick/scenegraph/coreapi/qsgmaterialrhishader.cpp @@ -97,14 +97,14 @@ static inline QRhiShaderResourceBinding::StageFlags toSrbStage(QShader::Stage st Q_UNREACHABLE(); break; } - return 0; + return { }; } void QSGMaterialRhiShaderPrivate::prepare(QShader::Variant vertexShaderVariant) { ubufBinding = -1; ubufSize = 0; - ubufStages = 0; + ubufStages = { }; memset(combinedImageSamplerBindings, 0, sizeof(combinedImageSamplerBindings)); vertexShader = fragmentShader = nullptr; masterUniformData.clear(); diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp index 1976538aec..e07f89a6d1 100644 --- a/src/quick/scenegraph/coreapi/qsgnode.cpp +++ b/src/quick/scenegraph/coreapi/qsgnode.cpp @@ -245,7 +245,6 @@ static void qt_print_node_count() */ QSGNode::QSGNode() : m_nodeFlags(OwnedByParent) - , m_dirtyState(nullptr) { init(); } @@ -264,7 +263,6 @@ QSGNode::QSGNode(NodeType type) , m_previousSibling(nullptr) , m_subtreeRenderableCount(type == GeometryNodeType || type == RenderNodeType ? 1 : 0) , m_nodeFlags(OwnedByParent) - , m_dirtyState(nullptr) { init(); } @@ -283,7 +281,6 @@ QSGNode::QSGNode(QSGNodePrivate &dd, NodeType type) , m_previousSibling(nullptr) , m_subtreeRenderableCount(type == GeometryNodeType || type == RenderNodeType ? 1 : 0) , m_nodeFlags(OwnedByParent) - , m_dirtyState(nullptr) , d_ptr(&dd) { init(); diff --git a/src/quick/scenegraph/coreapi/qsgnode.h b/src/quick/scenegraph/coreapi/qsgnode.h index cb677de030..5a7faed5e0 100644 --- a/src/quick/scenegraph/coreapi/qsgnode.h +++ b/src/quick/scenegraph/coreapi/qsgnode.h @@ -146,7 +146,7 @@ public: QT_DEPRECATED void clearDirty() { } void markDirty(DirtyState bits); - QT_DEPRECATED DirtyState dirtyState() const { return nullptr; } + QT_DEPRECATED DirtyState dirtyState() const { return { }; } virtual bool isSubtreeBlocked() const; diff --git a/src/quick/scenegraph/coreapi/qsgrhivisualizer.cpp b/src/quick/scenegraph/coreapi/qsgrhivisualizer.cpp index 38d4c4440f..a0131a3f67 100644 --- a/src/quick/scenegraph/coreapi/qsgrhivisualizer.cpp +++ b/src/quick/scenegraph/coreapi/qsgrhivisualizer.cpp @@ -400,7 +400,7 @@ void RhiVisualizer::ChangeVis::gather(Node *n) // This is because many changes don't propegate their dirty state to the // parent so the node updater will not unset these states. They are // not used for anything so, unsetting it should have no side effects. - n->dirtyState = nullptr; + n->dirtyState = { }; } SHADOWNODE_TRAVERSE(n) { diff --git a/src/quick/scenegraph/qsgcontextplugin.cpp b/src/quick/scenegraph/qsgcontextplugin.cpp index 66add51c55..7dfb8488ae 100644 --- a/src/quick/scenegraph/qsgcontextplugin.cpp +++ b/src/quick/scenegraph/qsgcontextplugin.cpp @@ -87,7 +87,6 @@ struct QSGAdaptationBackendData }; QSGAdaptationBackendData::QSGAdaptationBackendData() - : flags(nullptr) { // Fill in the table with the built-in adaptations. builtIns.append(new QSGSoftwareAdaptation); diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index f609055677..da6e524623 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -747,7 +747,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) const bool needsPresent = alsoSwap && window->isVisible(); if (cd->swapchain) { - QRhi::EndFrameFlags flags = 0; + QRhi::EndFrameFlags flags; if (!needsPresent) flags |= QRhi::SkipPresent; QRhi::FrameOpResult frameResult = rhi->endFrame(cd->swapchain, flags); diff --git a/src/quick/scenegraph/qsgrhilayer.cpp b/src/quick/scenegraph/qsgrhilayer.cpp index 757410eded..952279a3ff 100644 --- a/src/quick/scenegraph/qsgrhilayer.cpp +++ b/src/quick/scenegraph/qsgrhilayer.cpp @@ -388,7 +388,7 @@ void QSGRhiLayer::grab() m_mirrorHorizontal ? -m_rect.width() : m_rect.width(), m_mirrorVertical ? m_rect.height() : -m_rect.height()); } - QSGAbstractRenderer::MatrixTransformFlags matrixFlags = 0; + QSGAbstractRenderer::MatrixTransformFlags matrixFlags; if (!m_rhi->isYUpInNDC()) matrixFlags |= QSGAbstractRenderer::MatrixTransformFlipY; m_renderer->setProjectionMatrixToRect(mirrored, matrixFlags); diff --git a/src/quick/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp index 12c6742342..34325a35f3 100644 --- a/src/quick/scenegraph/qsgrhisupport.cpp +++ b/src/quick/scenegraph/qsgrhisupport.cpp @@ -465,7 +465,7 @@ QRhi *QSGRhiSupport::createRhi(QWindow *window, QOffscreenSurface *offscreenSurf { QRhi *rhi = nullptr; - QRhi::Flags flags = 0; + QRhi::Flags flags; if (isProfilingRequested()) flags |= QRhi::EnableProfiling | QRhi::EnableDebugMarkers; if (isSoftwareRendererRequested()) diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index dc1f97de54..c27ec5a263 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -824,7 +824,7 @@ void QSGRenderThread::syncAndRender(QImage *grabImage) } if (cd->swapchain) { - QRhi::EndFrameFlags flags = 0; + QRhi::EndFrameFlags flags; if (grabImage) flags |= QRhi::SkipPresent; QRhi::FrameOpResult frameResult = rhi->endFrame(cd->swapchain, flags); diff --git a/src/quick/scenegraph/util/qsgplaintexture.cpp b/src/quick/scenegraph/util/qsgplaintexture.cpp index fdebe03494..0361a941db 100644 --- a/src/quick/scenegraph/util/qsgplaintexture.cpp +++ b/src/quick/scenegraph/util/qsgplaintexture.cpp @@ -281,7 +281,7 @@ void QSGPlainTexture::setTextureFromNativeObject(QRhi *rhi, QQuickWindow::Native { Q_UNUSED(type); - QRhiTexture::Flags flags = 0; + QRhiTexture::Flags flags; if (mipmap) flags |= QRhiTexture::MipMapped | QRhiTexture::UsedWithGenerateMips; @@ -421,7 +421,7 @@ void QSGPlainTexturePrivate::updateRhiTexture(QRhi *rhi, QRhiResourceUpdateBatch } if (!q->m_texture) { - QRhiTexture::Flags f = 0; + QRhiTexture::Flags f; if (hasMipMaps) f |= QRhiTexture::MipMapped | QRhiTexture::UsedWithGenerateMips; |