From e579076bb36e6594003b2ade7f3d062944ef6f47 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 16 Nov 2016 14:22:36 +0100 Subject: Get rid of most QT_NO_FOO usages Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann --- src/quick/items/context2d/qquickcanvasitem.cpp | 2 +- src/quick/items/context2d/qquickcontext2d.cpp | 14 +++++++------- src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp | 2 +- src/quick/items/context2d/qquickcontext2dtexture.cpp | 10 +++++----- src/quick/items/context2d/qquickcontext2dtexture_p.h | 8 ++++---- src/quick/items/context2d/qquickcontext2dtile.cpp | 4 ++-- src/quick/items/context2d/qquickcontext2dtile_p.h | 4 ++-- 7 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src/quick/items/context2d') diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index 3b2b125c63..212148b754 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -802,7 +802,7 @@ QSGTextureProvider *QQuickCanvasItem::textureProvider() const return QQuickItem::textureProvider(); Q_D(const QQuickCanvasItem); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QQuickWindow *w = window(); if (!w || !w->isSceneGraphInitialized() || QThread::currentThread() != QQuickWindowPrivate::get(w)->context->thread()) { diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index 2483a8eadb..bcaedd67b4 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -75,7 +75,7 @@ #include #include -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include #endif @@ -3997,7 +3997,7 @@ public: ~QQuickContext2DThreadCleanup() { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) context->makeCurrent(surface); delete texture; context->doneCurrent(); @@ -4038,7 +4038,7 @@ QQuickContext2D::~QQuickContext2D() delete m_buffer; if (m_renderTarget == QQuickCanvasItem::FramebufferObject) { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) if (m_renderStrategy == QQuickCanvasItem::Immediate && m_glContext) { Q_ASSERT(QThread::currentThread() == m_glContext->thread()); m_glContext->makeCurrent(m_surface.data()); @@ -4115,7 +4115,7 @@ void QQuickContext2D::init(QQuickCanvasItem *canvasItem, const QVariantMap &args m_texture = new QQuickContext2DImageTexture; break; case QQuickCanvasItem::FramebufferObject: -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) m_texture = new QQuickContext2DFBOTexture; #else // It shouldn't be possible to use a FramebufferObject without OpenGL @@ -4134,7 +4134,7 @@ void QQuickContext2D::init(QQuickCanvasItem *canvasItem, const QVariantMap &args m_thread = QThread::currentThread(); QThread *renderThread = m_thread; -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QQuickWindow *window = canvasItem->window(); QQuickWindowPrivate *wd = QQuickWindowPrivate::get(window); QThread *sceneGraphThread = wd->context->thread(); @@ -4151,7 +4151,7 @@ void QQuickContext2D::init(QQuickCanvasItem *canvasItem, const QVariantMap &args if (renderThread && renderThread != QThread::currentThread()) m_texture->moveToThread(renderThread); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) if (m_renderTarget == QQuickCanvasItem::FramebufferObject && renderThread != sceneGraphThread) { auto openglRenderContext = static_cast(QQuickWindowPrivate::get(window)->context); QOpenGLContext *cc = openglRenderContext->openglContext(); @@ -4212,7 +4212,7 @@ QImage QQuickContext2D::toImage(const QRectF& bounds) flush(); m_texture->grabImage(bounds); } else { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QQuickWindow *window = m_canvas->window(); QOpenGLContext *ctx = window ? window->openglContext() : 0; if (ctx && ctx->isValid()) { diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp index 8d659040b3..b985cb0ccc 100644 --- a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp +++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp @@ -43,7 +43,7 @@ #include #include #include -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include # include #endif diff --git a/src/quick/items/context2d/qquickcontext2dtexture.cpp b/src/quick/items/context2d/qquickcontext2dtexture.cpp index 4435c0c37b..38b5f054bf 100644 --- a/src/quick/items/context2d/qquickcontext2dtexture.cpp +++ b/src/quick/items/context2d/qquickcontext2dtexture.cpp @@ -44,7 +44,7 @@ #include #include "qquickcontext2dcommandbuffer_p.h" #include -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) #include #include #include @@ -53,7 +53,7 @@ #include QT_BEGIN_NAMESPACE -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) #define QT_MINIMUM_FBO_SIZE 64 static inline int qt_next_power_of_two(int v) @@ -90,7 +90,7 @@ struct GLAcquireContext { #endif QQuickContext2DTexture::QQuickContext2DTexture() : m_context(0) -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) , m_gl(0) #endif , m_surface(0) @@ -254,7 +254,7 @@ void QQuickContext2DTexture::paint(QQuickContext2DCommandBuffer *ccb) return; } QQuickContext2D::mutex.unlock(); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) GLAcquireContext currentContext(m_gl, m_surface); #endif if (!m_tiledCanvas) { @@ -383,7 +383,7 @@ bool QQuickContext2DTexture::event(QEvent *e) } return QObject::event(e); } -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) static inline QSize npotAdjustedSize(const QSize &size) { static bool checked = false; diff --git a/src/quick/items/context2d/qquickcontext2dtexture_p.h b/src/quick/items/context2d/qquickcontext2dtexture_p.h index 6a5d4e8b09..04d7b40ab7 100644 --- a/src/quick/items/context2d/qquickcontext2dtexture_p.h +++ b/src/quick/items/context2d/qquickcontext2dtexture_p.h @@ -58,7 +58,7 @@ QT_REQUIRE_CONFIG(quick_canvas); #include #include "qquickcanvasitem_p.h" #include "qquickcontext2d_p.h" -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include # include #endif @@ -125,7 +125,7 @@ public: // Called during sync() on the scene graph thread while GUI is blocked. virtual QSGTexture *textureForNextFrame(QSGTexture *lastFrame, QQuickWindow *window) = 0; bool event(QEvent *e); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) void initializeOpenGL(QOpenGLContext *gl, QOffscreenSurface *s) { m_gl = gl; m_surface = s; @@ -157,7 +157,7 @@ protected: QList m_tiles; QQuickContext2D *m_context; -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QOpenGLContext *m_gl; #endif QSurface *m_surface; @@ -180,7 +180,7 @@ protected: uint m_painting : 1; uint m_onCustomThread : 1; // Not GUI and not SGRender }; -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) class QQuickContext2DFBOTexture : public QQuickContext2DTexture { Q_OBJECT diff --git a/src/quick/items/context2d/qquickcontext2dtile.cpp b/src/quick/items/context2d/qquickcontext2dtile.cpp index 95b6c9d961..d31fee7f91 100644 --- a/src/quick/items/context2d/qquickcontext2dtile.cpp +++ b/src/quick/items/context2d/qquickcontext2dtile.cpp @@ -38,7 +38,7 @@ ****************************************************************************/ #include "qquickcontext2dtile_p.h" -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include # include # include @@ -97,7 +97,7 @@ QPainter* QQuickContext2DTile::createPainter(bool smooth, bool antialiasing) return 0; } -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QQuickContext2DFBOTile::QQuickContext2DFBOTile() : QQuickContext2DTile() , m_fbo(0) diff --git a/src/quick/items/context2d/qquickcontext2dtile_p.h b/src/quick/items/context2d/qquickcontext2dtile_p.h index 2f3fdeb54f..e7eed7b086 100644 --- a/src/quick/items/context2d/qquickcontext2dtile_p.h +++ b/src/quick/items/context2d/qquickcontext2dtile_p.h @@ -56,7 +56,7 @@ QT_REQUIRE_CONFIG(quick_canvas); #include "qquickcontext2d_p.h" -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include #endif QT_BEGIN_NAMESPACE @@ -87,7 +87,7 @@ protected: QPainter m_painter; }; -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) class QQuickContext2DFBOTile : public QQuickContext2DTile { public: -- cgit v1.2.3