aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgdefaultlayer.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-02-21 10:41:54 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-02-26 07:13:18 +0000
commit499ec43937e926e4f2fa57a9baa455fcb3862262 (patch)
tree206c90d47387f8322b68f5e3db613189397e1af3 /src/quick/scenegraph/qsgdefaultlayer.cpp
parent53d1e9ed21d25e65a2f13606af479838f5f21fe7 (diff)
use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultlayer.cpp')
-rw-r--r--src/quick/scenegraph/qsgdefaultlayer.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/quick/scenegraph/qsgdefaultlayer.cpp b/src/quick/scenegraph/qsgdefaultlayer.cpp
index cd9c4a9a90..b2b123912f 100644
--- a/src/quick/scenegraph/qsgdefaultlayer.cpp
+++ b/src/quick/scenegraph/qsgdefaultlayer.cpp
@@ -90,15 +90,15 @@ namespace
QSGDefaultLayer::QSGDefaultLayer(QSGRenderContext *context)
: QSGLayer()
- , m_item(0)
+ , m_item(nullptr)
, m_device_pixel_ratio(1)
, m_format(GL_RGBA)
- , m_renderer(0)
- , m_fbo(0)
- , m_secondaryFbo(0)
+ , m_renderer(nullptr)
+ , m_fbo(nullptr)
+ , m_secondaryFbo(nullptr)
, m_transparentTexture(0)
#ifdef QSG_DEBUG_FBO_OVERLAY
- , m_debugOverlay(0)
+ , m_debugOverlay(nullptr)
#endif
, m_samples(0)
, m_mipmap(false)
@@ -122,13 +122,13 @@ QSGDefaultLayer::~QSGDefaultLayer()
void QSGDefaultLayer::invalidated()
{
delete m_renderer;
- m_renderer = 0;
+ m_renderer = nullptr;
delete m_fbo;
delete m_secondaryFbo;
- m_fbo = m_secondaryFbo = 0;
+ m_fbo = m_secondaryFbo = nullptr;
#ifdef QSG_DEBUG_FBO_OVERLAY
delete m_debugOverlay;
- m_debugOverlay = 0;
+ m_debugOverlay = nullptr;
#endif
if (m_transparentTexture) {
QOpenGLContext::currentContext()->functions()->glDeleteTextures(1, &m_transparentTexture);
@@ -204,7 +204,7 @@ void QSGDefaultLayer::setItem(QSGNode *item)
if (m_live && !m_item) {
delete m_fbo;
delete m_secondaryFbo;
- m_fbo = m_secondaryFbo = 0;
+ m_fbo = m_secondaryFbo = nullptr;
m_depthStencilBuffer.clear();
}
@@ -228,7 +228,7 @@ void QSGDefaultLayer::setSize(const QSize &size)
if (m_live && m_size.isNull()) {
delete m_fbo;
delete m_secondaryFbo;
- m_fbo = m_secondaryFbo = 0;
+ m_fbo = m_secondaryFbo = nullptr;
m_depthStencilBuffer.clear();
}
@@ -252,7 +252,7 @@ void QSGDefaultLayer::setLive(bool live)
if (m_live && (!m_item || m_size.isNull())) {
delete m_fbo;
delete m_secondaryFbo;
- m_fbo = m_secondaryFbo = 0;
+ m_fbo = m_secondaryFbo = nullptr;
m_depthStencilBuffer.clear();
}
@@ -295,7 +295,7 @@ void QSGDefaultLayer::grab()
if (!m_item || m_size.isNull()) {
delete m_fbo;
delete m_secondaryFbo;
- m_fbo = m_secondaryFbo = 0;
+ m_fbo = m_secondaryFbo = nullptr;
m_depthStencilBuffer.clear();
m_dirtyTexture = false;
return;
@@ -362,7 +362,7 @@ void QSGDefaultLayer::grab()
delete m_fbo;
delete m_secondaryFbo;
m_fbo = new QOpenGLFramebufferObject(m_size, format);
- m_secondaryFbo = 0;
+ m_secondaryFbo = nullptr;
funcs->glBindTexture(GL_TEXTURE_2D, m_fbo->texture());
updateBindOptions(true);
m_depthStencilBuffer = m_context->depthStencilBufferForFbo(m_fbo);