From 1175c3b5405015a27bc28d836e96582f02d3ce00 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 23 Dec 2020 10:03:12 +0100 Subject: Modernize code base Run clang-tidy over the code base with some code modernization options. Change-Id: I9e74d1225bce333e74224e3b92c02c7e9884d8f5 Reviewed-by: Lars Knoll Reviewed-by: Doris Verria --- src/qtmultimediaquicktools/qsgvideonode_texture.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/qtmultimediaquicktools/qsgvideonode_texture.cpp') diff --git a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp index 68e0d2d1a..5c76aec45 100644 --- a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp +++ b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp @@ -80,7 +80,7 @@ QSGVideoNode *QSGVideoNodeFactory_Texture::createNode(const QVideoSurfaceFormat if (supportedPixelFormats(format.handleType()).contains(format.pixelFormat())) return new QSGVideoNode_Texture(format); - return 0; + return nullptr; } class QSGVideoMaterialRhiShader_Texture : public QSGMaterialShader @@ -119,16 +119,16 @@ public: m_texture.reset(new QSGVideoTexture); } - ~QSGVideoMaterial_Texture() + ~QSGVideoMaterial_Texture() override { } - QSGMaterialType *type() const override { + [[nodiscard]] QSGMaterialType *type() const override { static QSGMaterialType normalType, swizzleType; return needsSwizzling() ? &swizzleType : &normalType; } - QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override { + [[nodiscard]] QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override { return needsSwizzling() ? new QSGVideoMaterialRhiShader_Texture_swizzle : new QSGVideoMaterialRhiShader_Texture; } @@ -157,7 +157,7 @@ public: QScopedPointer m_texture; private: - bool needsSwizzling() const { + [[nodiscard]] bool needsSwizzling() const { return m_format.pixelFormat() == QVideoFrame::Format_RGB32 || m_format.pixelFormat() == QVideoFrame::Format_ARGB32; } -- cgit v1.2.3