summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengltexture.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-22 14:46:58 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-12-06 12:13:20 +0100
commitece0c0a5e7e0b18beb58ccd868bde54c7be64f78 (patch)
treefa4a0fdbda040d24f1a2d07a320635c76980f431 /src/gui/opengl/qopengltexture.cpp
parentb19220d17fa66de5ded41690ffff263ee2af5c63 (diff)
Tidy nullptr usage
Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/opengl/qopengltexture.cpp')
-rw-r--r--src/gui/opengl/qopengltexture.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index 61a6202017..cf4a8dee8d 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
QOpenGLTexturePrivate::QOpenGLTexturePrivate(QOpenGLTexture::Target textureTarget,
QOpenGLTexture *qq)
: q_ptr(qq),
- context(0),
+ context(nullptr),
target(textureTarget),
textureId(0),
format(QOpenGLTexture::NoFormat),
@@ -82,8 +82,8 @@ QOpenGLTexturePrivate::QOpenGLTexturePrivate(QOpenGLTexture::Target textureTarge
textureView(false),
autoGenerateMipMaps(true),
storageAllocated(false),
- texFuncs(0),
- functions(0)
+ texFuncs(nullptr),
+ functions(nullptr)
{
dimensions[0] = dimensions[1] = dimensions[2] = 1;
@@ -208,8 +208,8 @@ void QOpenGLTexturePrivate::destroy()
functions->glDeleteTextures(1, &textureId);
- context = 0;
- functions = 0;
+ context = nullptr;
+ functions = nullptr;
textureId = 0;
format = QOpenGLTexture::NoFormat;
formatClass = QOpenGLTexture::NoFormatClass;
@@ -231,7 +231,7 @@ void QOpenGLTexturePrivate::destroy()
textureView = false;
autoGenerateMipMaps = true;
storageAllocated = false;
- texFuncs = 0;
+ texFuncs = nullptr;
swizzleMask[0] = QOpenGLTexture::RedValue;
swizzleMask[1] = QOpenGLTexture::GreenValue;
@@ -1141,7 +1141,7 @@ void QOpenGLTexturePrivate::allocateMutableStorage(QOpenGLTexture::PixelFormat p
texFuncs->glTextureImage1D(textureId, target, bindingTarget, level, format,
mipLevelSize(level, dimensions[0]),
0,
- pixelFormat, pixelType, 0);
+ pixelFormat, pixelType, nullptr);
} else {
qWarning("1D textures are not supported");
return;
@@ -1156,7 +1156,7 @@ void QOpenGLTexturePrivate::allocateMutableStorage(QOpenGLTexture::PixelFormat p
mipLevelSize(level, dimensions[0]),
layers,
0,
- pixelFormat, pixelType, 0);
+ pixelFormat, pixelType, nullptr);
} else {
qWarning("1D array textures are not supported");
return;
@@ -1170,7 +1170,7 @@ void QOpenGLTexturePrivate::allocateMutableStorage(QOpenGLTexture::PixelFormat p
mipLevelSize(level, dimensions[0]),
mipLevelSize(level, dimensions[1]),
0,
- pixelFormat, pixelType, 0);
+ pixelFormat, pixelType, nullptr);
break;
case QOpenGLTexture::TargetCubeMap: {
@@ -1190,7 +1190,7 @@ void QOpenGLTexturePrivate::allocateMutableStorage(QOpenGLTexture::PixelFormat p
mipLevelSize(level, dimensions[0]),
mipLevelSize(level, dimensions[1]),
0,
- pixelFormat, pixelType, 0);
+ pixelFormat, pixelType, nullptr);
}
}
break;
@@ -1204,7 +1204,7 @@ void QOpenGLTexturePrivate::allocateMutableStorage(QOpenGLTexture::PixelFormat p
mipLevelSize(level, dimensions[1]),
layers,
0,
- pixelFormat, pixelType, 0);
+ pixelFormat, pixelType, nullptr);
} else {
qWarning("Array textures are not supported");
return;
@@ -1220,7 +1220,7 @@ void QOpenGLTexturePrivate::allocateMutableStorage(QOpenGLTexture::PixelFormat p
mipLevelSize(level, dimensions[1]),
6 * layers,
0,
- pixelFormat, pixelType, 0);
+ pixelFormat, pixelType, nullptr);
} else {
qWarning("Cubemap Array textures are not supported");
return;
@@ -1235,7 +1235,7 @@ void QOpenGLTexturePrivate::allocateMutableStorage(QOpenGLTexture::PixelFormat p
mipLevelSize(level, dimensions[1]),
mipLevelSize(level, dimensions[2]),
0,
- pixelFormat, pixelType, 0);
+ pixelFormat, pixelType, nullptr);
} else {
qWarning("3D textures are not supported");
return;
@@ -1924,7 +1924,7 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target
if (!viewTargetCompatible) {
qWarning("QOpenGLTexture::createTextureView(): Incompatible source and view targets");
- return 0;
+ return nullptr;
}
// Check the formats are compatible
@@ -2057,7 +2057,7 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target
if (!viewFormatCompatible) {
qWarning("QOpenGLTexture::createTextureView(): Incompatible source and view formats");
- return 0;
+ return nullptr;
}
@@ -3387,7 +3387,7 @@ QOpenGLTexture *QOpenGLTexture::createTextureView(Target target,
Q_D(const QOpenGLTexture);
if (!isStorageAllocated()) {
qWarning("Cannot set create a texture view of a texture that does not have storage allocated.");
- return 0;
+ return nullptr;
}
Q_ASSERT(maximumMipmapLevel >= minimumMipmapLevel);
Q_ASSERT(maximumLayer >= minimumLayer);