aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickpainteditem.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-06-10 09:26:52 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-06-11 22:23:50 +0200
commit132e2fb2bf28c6aa3c1598deecf4d723f83396ec (patch)
tree805c55e6e49b2b05500b5ecf1f563fdf15e068be /src/quick/items/qquickpainteditem.cpp
parent2cb24f7054e1105be0dcb1a4d61a5b52d62d1a55 (diff)
Make openglContext getter in QQuickWindow private
Fix up the scenegraph and qquickwindow autotests as well. (direct OpenGL specifics are now completely removed from both, i.e. the remaning OpenGL specific tests are now run (and not skipped) with OpenGL-on-RHI) [ChangeLog][Qt Quick][QQuickWindow] openglContext() has been removed from QQuickWindow. Use QSGRendererInterface to query the QOpenGLContext. Change-Id: If5c9802b71ac5f9cffc695827e286eb2a2d03580 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/items/qquickpainteditem.cpp')
-rw-r--r--src/quick/items/qquickpainteditem.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp
index 1eb852f6bf..f7ceac9f29 100644
--- a/src/quick/items/qquickpainteditem.cpp
+++ b/src/quick/items/qquickpainteditem.cpp
@@ -44,9 +44,7 @@
#include <QtQuick/private/qsgcontext_p.h>
#include <private/qsgadaptationlayer_p.h>
#include <qsgtextureprovider.h>
-#if QT_CONFIG(opengl)
-#include <QOpenGLContext>
-#endif // QT_CONFIG(opengl)
+#include <QtGui/private/qrhi_p.h>
#include <qmath.h>
@@ -662,7 +660,7 @@ QSGTextureProvider *QQuickPaintedItem::textureProvider() const
Q_D(const QQuickPaintedItem);
#if QT_CONFIG(opengl)
QQuickWindow *w = window();
- if (!w || !w->openglContext() || QThread::currentThread() != w->openglContext()->thread()) {
+ if (!w || !w->isSceneGraphInitialized() || QThread::currentThread() != QQuickWindowPrivate::get(w)->context->thread()) {
qWarning("QQuickPaintedItem::textureProvider: can only be queried on the rendering thread of an exposed window");
return nullptr;
}