summaryrefslogtreecommitdiffstats
path: root/src/qtmultimediaquicktools/qsgvideonode_texture.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-12-23 10:03:12 +0100
committerLars Knoll <lars.knoll@qt.io>2021-01-21 19:55:52 +0000
commit1175c3b5405015a27bc28d836e96582f02d3ce00 (patch)
tree9d466f156414b29b4264acf748860283ec96c499 /src/qtmultimediaquicktools/qsgvideonode_texture.cpp
parent083d12af7be12a6076e1be779452909f37262a61 (diff)
Modernize code base
Run clang-tidy over the code base with some code modernization options. Change-Id: I9e74d1225bce333e74224e3b92c02c7e9884d8f5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
Diffstat (limited to 'src/qtmultimediaquicktools/qsgvideonode_texture.cpp')
-rw-r--r--src/qtmultimediaquicktools/qsgvideonode_texture.cpp10
1 files changed, 5 insertions, 5 deletions
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<QSGVideoTexture> m_texture;
private:
- bool needsSwizzling() const {
+ [[nodiscard]] bool needsSwizzling() const {
return m_format.pixelFormat() == QVideoFrame::Format_RGB32
|| m_format.pixelFormat() == QVideoFrame::Format_ARGB32;
}