summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
diff options
context:
space:
mode:
authorKevin Funk <kevin.funk@kdab.com>2019-03-12 11:46:26 +0100
committerKevin Funk <kevin.funk@kdab.com>2019-03-14 07:37:52 +0000
commit41e7b71c410b77a81d09d3cc2e169ffd7975b4d2 (patch)
treefd0722a70d1aedf8567cc11babd10adcbbd1e797 /src/gui/opengl
parentb35eec360d4d88d094094fb54c101fad6cee5768 (diff)
More nullptr usage in headers
Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/gui/opengl')
-rw-r--r--src/gui/opengl/qopenglengineshadermanager_p.h2
-rw-r--r--src/gui/opengl/qopenglextensions_p.h2
-rw-r--r--src/gui/opengl/qopenglframebufferobject_p.h8
-rw-r--r--src/gui/opengl/qopenglpaintengine_p.h8
-rw-r--r--src/gui/opengl/qopenglqueryhelper_p.h24
-rw-r--r--src/gui/opengl/qopengltextureglyphcache_p.h2
-rw-r--r--src/gui/opengl/qopengltexturehelper_p.h18
7 files changed, 32 insertions, 32 deletions
diff --git a/src/gui/opengl/qopenglengineshadermanager_p.h b/src/gui/opengl/qopenglengineshadermanager_p.h
index d43788d777..14c79f5de3 100644
--- a/src/gui/opengl/qopenglengineshadermanager_p.h
+++ b/src/gui/opengl/qopenglengineshadermanager_p.h
@@ -370,7 +370,7 @@ private:
class QOpenGLEngineShaderProg
{
public:
- QOpenGLEngineShaderProg() : program(0) {}
+ QOpenGLEngineShaderProg() : program(nullptr) {}
~QOpenGLEngineShaderProg() {
if (program)
diff --git a/src/gui/opengl/qopenglextensions_p.h b/src/gui/opengl/qopenglextensions_p.h
index af8ee8201d..137f1e831f 100644
--- a/src/gui/opengl/qopenglextensions_p.h
+++ b/src/gui/opengl/qopenglextensions_p.h
@@ -107,7 +107,7 @@ public:
QOpenGLExtensionsPrivate *d() const;
private:
- static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != 0; }
+ static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != nullptr; }
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLExtensions::OpenGLExtensions)
diff --git a/src/gui/opengl/qopenglframebufferobject_p.h b/src/gui/opengl/qopenglframebufferobject_p.h
index 778a38b823..644bb6c59b 100644
--- a/src/gui/opengl/qopenglframebufferobject_p.h
+++ b/src/gui/opengl/qopenglframebufferobject_p.h
@@ -109,8 +109,8 @@ public:
class QOpenGLFramebufferObjectPrivate
{
public:
- QOpenGLFramebufferObjectPrivate() : fbo_guard(0), depth_buffer_guard(0)
- , stencil_buffer_guard(0)
+ QOpenGLFramebufferObjectPrivate() : fbo_guard(nullptr), depth_buffer_guard(nullptr)
+ , stencil_buffer_guard(nullptr)
, valid(false) {}
~QOpenGLFramebufferObjectPrivate() {}
@@ -135,9 +135,9 @@ public:
QOpenGLExtensions funcs;
struct ColorAttachment {
- ColorAttachment() : internalFormat(0), guard(0) { }
+ ColorAttachment() : internalFormat(0), guard(nullptr) { }
ColorAttachment(const QSize &size, GLenum internalFormat)
- : size(size), internalFormat(internalFormat), guard(0) { }
+ : size(size), internalFormat(internalFormat), guard(nullptr) { }
QSize size;
GLenum internalFormat;
QOpenGLSharedResourceGuard *guard;
diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h
index 15ac240b89..81f17572b2 100644
--- a/src/gui/opengl/qopenglpaintengine_p.h
+++ b/src/gui/opengl/qopenglpaintengine_p.h
@@ -187,9 +187,9 @@ public:
QOpenGL2PaintEngineExPrivate(QOpenGL2PaintEngineEx *q_ptr) :
q(q_ptr),
- shaderManager(0),
+ shaderManager(nullptr),
width(0), height(0),
- ctx(0),
+ ctx(nullptr),
useSystemClip(true),
elementIndicesVBOId(0),
opacityArray(0),
@@ -361,9 +361,9 @@ void QOpenGL2PaintEngineExPrivate::uploadData(unsigned int arrayIndex, const GLf
opacityBuffer.allocate(data, count * sizeof(float));
}
if (arrayIndex == QT_OPACITY_ATTR)
- funcs.glVertexAttribPointer(arrayIndex, 1, GL_FLOAT, GL_FALSE, 0, 0);
+ funcs.glVertexAttribPointer(arrayIndex, 1, GL_FLOAT, GL_FALSE, 0, nullptr);
else
- funcs.glVertexAttribPointer(arrayIndex, 2, GL_FLOAT, GL_FALSE, 0, 0);
+ funcs.glVertexAttribPointer(arrayIndex, 2, GL_FLOAT, GL_FALSE, 0, nullptr);
} else {
// If we already uploaded the data we don't have to do it again
if (data == vertexAttribPointers[arrayIndex])
diff --git a/src/gui/opengl/qopenglqueryhelper_p.h b/src/gui/opengl/qopenglqueryhelper_p.h
index 60dbf9c743..ad91ca9f96 100644
--- a/src/gui/opengl/qopenglqueryhelper_p.h
+++ b/src/gui/opengl/qopenglqueryhelper_p.h
@@ -65,18 +65,18 @@ class QOpenGLQueryHelper
{
public:
QOpenGLQueryHelper(QOpenGLContext *context)
- : GetQueryObjectuiv(0),
- GetQueryObjectiv(0),
- GetQueryiv(0),
- EndQuery(0),
- BeginQuery(0),
- IsQuery(0),
- DeleteQueries(0),
- GenQueries(0),
- GetInteger64v(0),
- GetQueryObjectui64v(0),
- GetQueryObjecti64v(0),
- QueryCounter(0)
+ : GetQueryObjectuiv(nullptr),
+ GetQueryObjectiv(nullptr),
+ GetQueryiv(nullptr),
+ EndQuery(nullptr),
+ BeginQuery(nullptr),
+ IsQuery(nullptr),
+ DeleteQueries(nullptr),
+ GenQueries(nullptr),
+ GetInteger64v(nullptr),
+ GetQueryObjectui64v(nullptr),
+ GetQueryObjecti64v(nullptr),
+ QueryCounter(nullptr)
{
Q_ASSERT(context);
diff --git a/src/gui/opengl/qopengltextureglyphcache_p.h b/src/gui/opengl/qopengltextureglyphcache_p.h
index 598cb00ee5..aed128cf9e 100644
--- a/src/gui/opengl/qopengltextureglyphcache_p.h
+++ b/src/gui/opengl/qopengltextureglyphcache_p.h
@@ -139,7 +139,7 @@ public:
inline void setPaintEnginePrivate(QOpenGL2PaintEngineExPrivate *p) { pex = p; }
- inline const QOpenGLContextGroup *contextGroup() const { return m_textureResource ? m_textureResource->group() : 0; }
+ inline const QOpenGLContextGroup *contextGroup() const { return m_textureResource ? m_textureResource->group() : nullptr; }
inline int serialNumber() const { return m_serialNumber; }
diff --git a/src/gui/opengl/qopengltexturehelper_p.h b/src/gui/opengl/qopengltexturehelper_p.h
index 00f6f9e5aa..62d0125daf 100644
--- a/src/gui/opengl/qopengltexturehelper_p.h
+++ b/src/gui/opengl/qopengltexturehelper_p.h
@@ -167,7 +167,7 @@ public:
inline void glTextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type,
- const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = 0)
+ const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -181,7 +181,7 @@ public:
inline void glTextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height, GLenum format, GLenum type,
- const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = 0)
+ const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -195,7 +195,7 @@ public:
inline void glTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset,
GLsizei width, GLenum format, GLenum type,
- const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = 0)
+ const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -222,7 +222,7 @@ public:
inline void glCompressedTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
GLint xoffset, GLsizei width,
GLenum format, GLsizei imageSize, const GLvoid *bits,
- const QOpenGLPixelTransferOptions * const options = 0)
+ const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -238,7 +238,7 @@ public:
GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height,
GLenum format, GLsizei imageSize, const GLvoid *bits,
- const QOpenGLPixelTransferOptions * const options = 0)
+ const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -254,7 +254,7 @@ public:
GLint xoffset, GLint yoffset, GLint zoffset,
GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLsizei imageSize, const GLvoid *bits,
- const QOpenGLPixelTransferOptions * const options = 0)
+ const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -269,7 +269,7 @@ public:
inline void glCompressedTextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
GLenum internalFormat, GLsizei width,
GLint border, GLsizei imageSize, const GLvoid *bits,
- const QOpenGLPixelTransferOptions * const options = 0)
+ const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -284,7 +284,7 @@ public:
inline void glCompressedTextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
GLenum internalFormat, GLsizei width, GLsizei height,
GLint border, GLsizei imageSize, const GLvoid *bits,
- const QOpenGLPixelTransferOptions * const options = 0)
+ const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
@@ -300,7 +300,7 @@ public:
inline void glCompressedTextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth,
GLint border, GLsizei imageSize, const GLvoid *bits,
- const QOpenGLPixelTransferOptions * const options = 0)
+ const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();