aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/context2d
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-12-14 19:01:23 +0100
committerLiang Qi <liang.qi@qt.io>2016-12-14 19:01:23 +0100
commit0e80d28aa5892d6bbb4d0017b1bc9a33489f4176 (patch)
tree0db2e10c8776d172bccaeaa7ee1fab3934b93073 /src/quick/items/context2d
parented32558d6280cae40578f735fd326327d571d993 (diff)
parent16c81bb0d493af00bc376784bcb7e03a4a037b04 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
Diffstat (limited to 'src/quick/items/context2d')
-rw-r--r--src/quick/items/context2d/qquickcanvasitem.cpp2
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp14
-rw-r--r--src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp2
-rw-r--r--src/quick/items/context2d/qquickcontext2dtexture.cpp10
-rw-r--r--src/quick/items/context2d/qquickcontext2dtexture_p.h8
-rw-r--r--src/quick/items/context2d/qquickcontext2dtile.cpp4
-rw-r--r--src/quick/items/context2d/qquickcontext2dtile_p.h4
7 files changed, 22 insertions, 22 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp
index dcad719ef0..78db92ba8a 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 <private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <private/qsgdefaultrendercontext_p.h>
#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<const QSGDefaultRenderContext *>(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 <QtCore/QMutex>
#include <QtQuick/qsgtexture.h>
#include <QtGui/QPaintEngine>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtGui/QOpenGLContext>
# include <QtGui/private/qopenglpaintengine_p.h>
#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 <QtQuick/private/qsgtexture_p.h>
#include "qquickcontext2dcommandbuffer_p.h"
#include <QOpenGLPaintDevice>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QOpenGLFramebufferObject>
#include <QOpenGLFramebufferObjectFormat>
#include <QOpenGLFunctions>
@@ -53,7 +53,7 @@
#include <QtGui/QGuiApplication>
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 678e33826d..97135816a2 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 <QtQuick/qsgtexture.h>
#include "qquickcanvasitem_p.h"
#include "qquickcontext2d_p.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QOpenGLContext>
# include <QOpenGLFramebufferObject>
#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) override;
-#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<QQuickContext2DTile*> 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 <QOpenGLFramebufferObject>
# include <QOpenGLFramebufferObjectFormat>
# include <QOpenGLPaintDevice>
@@ -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 02238a882b..d5255edcfc 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 <QOpenGLFramebufferObject>
#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: