aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/declarative.pro2
-rw-r--r--src/declarative/items/context2d/qsgcontext2d.cpp2
-rw-r--r--src/declarative/items/qsgcanvas.cpp10
-rw-r--r--src/declarative/items/qsgcanvas.h8
-rw-r--r--src/declarative/items/qsgcanvas_p.h12
-rw-r--r--src/declarative/items/qsgpainteditem.cpp6
-rw-r--r--src/declarative/items/qsgshadereffect.cpp2
-rw-r--r--src/declarative/items/qsgshadereffectmesh_p.h3
-rw-r--r--src/declarative/items/qsgshadereffectnode.cpp2
-rw-r--r--src/declarative/items/qsgshadereffectsource.cpp34
-rw-r--r--src/declarative/items/qsgshadereffectsource_p.h6
-rw-r--r--src/declarative/items/qsgspriteengine.cpp2
-rw-r--r--src/declarative/items/qsgtextnode_p.h1
-rw-r--r--src/declarative/particles/qsgimageparticle.cpp22
-rw-r--r--src/declarative/scenegraph/coreapi/qsggeometry.h3
-rw-r--r--src/declarative/scenegraph/coreapi/qsgmaterial.cpp16
-rw-r--r--src/declarative/scenegraph/coreapi/qsgmaterial.h8
-rw-r--r--src/declarative/scenegraph/coreapi/qsgrenderer.cpp14
-rw-r--r--src/declarative/scenegraph/coreapi/qsgrenderer_p.h18
-rw-r--r--src/declarative/scenegraph/qsgadaptationlayer_p.h1
-rw-r--r--src/declarative/scenegraph/qsgcontext.cpp12
-rw-r--r--src/declarative/scenegraph/qsgcontext_p.h11
-rw-r--r--src/declarative/scenegraph/qsgdefaultglyphnode.cpp2
-rw-r--r--src/declarative/scenegraph/qsgdefaultglyphnode_p.cpp21
-rw-r--r--src/declarative/scenegraph/qsgdefaultglyphnode_p_p.h5
-rw-r--r--src/declarative/scenegraph/qsgdefaultimagenode.cpp6
-rw-r--r--src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp52
-rw-r--r--src/declarative/scenegraph/qsgdistancefieldglyphcache_p.h46
-rw-r--r--src/declarative/scenegraph/qsgdistancefieldglyphnode_p.cpp2
-rw-r--r--src/declarative/scenegraph/qsgpathsimplifier.cpp2
-rw-r--r--src/declarative/scenegraph/scenegraph.pri3
-rw-r--r--src/declarative/scenegraph/util/qsgflatcolormaterial.cpp2
-rw-r--r--src/declarative/scenegraph/util/qsgflatcolormaterial.h1
-rw-r--r--src/declarative/scenegraph/util/qsgpainternode.cpp33
-rw-r--r--src/declarative/scenegraph/util/qsgpainternode_p.h6
-rw-r--r--src/declarative/scenegraph/util/qsgtexture.cpp8
-rw-r--r--src/declarative/scenegraph/util/qsgtexture_p.h2
-rw-r--r--src/declarative/scenegraph/util/qsgtexturematerial.cpp6
-rw-r--r--src/declarative/scenegraph/util/qsgvertexcolormaterial.cpp2
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp3
-rw-r--r--src/imports/etcprovider/qetcprovider.cpp5
-rw-r--r--src/imports/etcprovider/qetcprovider.h2
-rw-r--r--src/qmltest/quicktest.cpp2
-rw-r--r--src/qmltest/quicktest.h6
44 files changed, 214 insertions, 198 deletions
diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro
index 336766b7cf..89b94526af 100644
--- a/src/declarative/declarative.pro
+++ b/src/declarative/declarative.pro
@@ -6,7 +6,7 @@ QPRO_PWD = $$PWD
CONFIG += module
MODULE_PRI += ../../modules/qt_declarative.pri
-QT = core-private gui-private network opengl opengl-private widgets-private sql
+QT = core-private gui gui-private network widgets-private sql
contains(QT_CONFIG, svg): QT += svg
DEFINES += QT_BUILD_DECLARATIVE_LIB QT_NO_URL_CAST_FROM_STRING
diff --git a/src/declarative/items/context2d/qsgcontext2d.cpp b/src/declarative/items/context2d/qsgcontext2d.cpp
index 4d455419ad..71bc7df980 100644
--- a/src/declarative/items/context2d/qsgcontext2d.cpp
+++ b/src/declarative/items/context2d/qsgcontext2d.cpp
@@ -43,7 +43,7 @@
#include "qsgcontext2d_p_p.h"
#include "private/qsgadaptationlayer_p.h"
#include "qsgcanvasitem_p.h"
-#include <QtOpenGL/qglframebufferobject.h>
+#include <QtGui/qopenglframebufferobject.h>
#include <QtCore/qdebug.h>
#include "private/qsgcontext_p.h"
diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp
index e6cda60c2b..8ff7d17837 100644
--- a/src/declarative/items/qsgcanvas.cpp
+++ b/src/declarative/items/qsgcanvas.cpp
@@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(qmlFixedAnimationStep, QML_FIXED_ANIMATION_STEP)
DEFINE_BOOL_CONFIG_OPTION(qmlNoThreadedRenderer, QML_BAD_GUI_RENDER_LOOP)
-extern Q_OPENGL_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
+extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
class QSGCanvasPlainRenderLoop : public QObject, public QSGCanvasRenderLoop
{
@@ -359,7 +359,7 @@ void QSGCanvasPrivate::initializeSceneGraph()
if (context->isReady())
return;
- QGLContext *glctx = const_cast<QGLContext *>(QGLContext::currentContext());
+ QOpenGLContext *glctx = const_cast<QOpenGLContext *>(QOpenGLContext::currentContext());
context->initialize(glctx);
Q_Q(QSGCanvas);
@@ -1894,7 +1894,7 @@ QSGEngine *QSGCanvas::sceneGraphEngine() const
the rendering.
*/
-void QSGCanvas::setRenderTarget(QGLFramebufferObject *fbo)
+void QSGCanvas::setRenderTarget(QOpenGLFramebufferObject *fbo)
{
Q_D(QSGCanvas);
if (d->context && d->context && QThread::currentThread() != d->context->thread()) {
@@ -1913,7 +1913,7 @@ void QSGCanvas::setRenderTarget(QGLFramebufferObject *fbo)
The default is to render to the surface of the canvas, in which
case the render target is 0.
*/
-QGLFramebufferObject *QSGCanvas::renderTarget() const
+QOpenGLFramebufferObject *QSGCanvas::renderTarget() const
{
Q_D(const QSGCanvas);
return d->renderTarget;
@@ -1939,7 +1939,7 @@ QImage QSGCanvas::grabFrameBuffer()
void QSGCanvasRenderLoop::createGLContext()
{
- gl = new QGuiGLContext();
+ gl = new QOpenGLContext();
gl->create();
}
diff --git a/src/declarative/items/qsgcanvas.h b/src/declarative/items/qsgcanvas.h
index be6b173de9..e364ee88f5 100644
--- a/src/declarative/items/qsgcanvas.h
+++ b/src/declarative/items/qsgcanvas.h
@@ -43,7 +43,7 @@
#define QSGCANVAS_H
#include <QtCore/qmetatype.h>
-#include <QtOpenGL/qgl.h>
+#include <QtGui/qopengl.h>
#include <QtWidgets/qwidget.h>
QT_BEGIN_HEADER
@@ -55,7 +55,7 @@ QT_MODULE(Declarative)
class QSGItem;
class QSGEngine;
class QSGCanvasPrivate;
-class QGLFramebufferObject;
+class QOpenGLFramebufferObject;
class Q_DECLARATIVE_EXPORT QSGCanvas : public QWindow
{
@@ -82,8 +82,8 @@ public:
QImage grabFrameBuffer();
- void setRenderTarget(QGLFramebufferObject *fbo);
- QGLFramebufferObject *renderTarget() const;
+ void setRenderTarget(QOpenGLFramebufferObject *fbo);
+ QOpenGLFramebufferObject *renderTarget() const;
signals:
void frameSwapped();
diff --git a/src/declarative/items/qsgcanvas_p.h b/src/declarative/items/qsgcanvas_p.h
index 592e66b454..e5347f53ae 100644
--- a/src/declarative/items/qsgcanvas_p.h
+++ b/src/declarative/items/qsgcanvas_p.h
@@ -65,9 +65,9 @@
#include <QtCore/qwaitcondition.h>
#include <private/qwidget_p.h>
#include <private/qwindow_p.h>
-#include <private/qgl_p.h>
-#include <qguiglcontext_qpa.h>
-#include <QtOpenGL/qglframebufferobject.h>
+#include <private/qopengl_p.h>
+#include <qopenglcontext.h>
+#include <QtGui/qopenglframebufferobject.h>
QT_BEGIN_NAMESPACE
@@ -169,7 +169,7 @@ public:
QAnimationDriver *animationDriver;
- QGLFramebufferObject *renderTarget;
+ QOpenGLFramebufferObject *renderTarget;
QHash<int, QSGItem *> itemForTouchPointId;
};
@@ -209,7 +209,7 @@ protected:
void polishItems() { d->polishItems(); }
QAnimationDriver *animationDriver() const { return d->animationDriver; }
- inline QGuiGLContext *glContext() const { return gl; }
+ inline QOpenGLContext *glContext() const { return gl; }
void createGLContext();
void makeCurrent() { gl->makeCurrent(renderer); }
void doneCurrent() { gl->doneCurrent(); }
@@ -222,7 +222,7 @@ private:
QSGCanvasPrivate *d;
QSGCanvas *renderer;
- QGuiGLContext *gl;
+ QOpenGLContext *gl;
};
class QSGCanvasRenderThread : public QThread, public QSGCanvasRenderLoop
diff --git a/src/declarative/items/qsgpainteditem.cpp b/src/declarative/items/qsgpainteditem.cpp
index 95aa2b4fb2..76d5a00e90 100644
--- a/src/declarative/items/qsgpainteditem.cpp
+++ b/src/declarative/items/qsgpainteditem.cpp
@@ -56,10 +56,10 @@ QT_BEGIN_NAMESPACE
The QSGPaintedItem makes it possible to use the QPainter API with the QML Scene Graph.
It sets up a textured rectangle in the Scene Graph and uses a QPainter to paint
- onto the texture. The render target can be either a QImage or a QGLFramebufferObject.
+ onto the texture. The render target can be either a QImage or a QOpenGLFramebufferObject.
When the render target is a QImage, QPainter first renders into the image then
the content is uploaded to the texture.
- When a QGLFramebufferObject is used, QPainter paints directly onto the texture.
+ When a QOpenGLFramebufferObject is used, QPainter paints directly onto the texture.
Call update() to trigger a repaint.
To enable QPainter to do anti-aliased rendering, use setAntialiasing().
@@ -84,7 +84,7 @@ QT_BEGIN_NAMESPACE
can potentially be slow if the item is large. This render target allows high quality
anti-aliasing and fast item resizing.
- \value FramebufferObject QPainter paints into a QGLFramebufferObject using the GL
+ \value FramebufferObject QPainter paints into a QOpenGLFramebufferObject using the GL
paint engine. Painting can be faster as no texture upload is required, but anti-aliasing
quality is not as good as if using an image. This render target allows faster rendering
in some cases, but you should avoid using it if the item is resized often.
diff --git a/src/declarative/items/qsgshadereffect.cpp b/src/declarative/items/qsgshadereffect.cpp
index 6649dc9f2c..b66f9c1813 100644
--- a/src/declarative/items/qsgshadereffect.cpp
+++ b/src/declarative/items/qsgshadereffect.cpp
@@ -53,7 +53,7 @@
#include <qsgshadereffectsource_p.h>
#include <QtCore/qsignalmapper.h>
-#include <QtOpenGL/qglframebufferobject.h>
+#include <QtGui/qopenglframebufferobject.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/items/qsgshadereffectmesh_p.h b/src/declarative/items/qsgshadereffectmesh_p.h
index 463c3d9073..4a1a8ae61b 100644
--- a/src/declarative/items/qsgshadereffectmesh_p.h
+++ b/src/declarative/items/qsgshadereffectmesh_p.h
@@ -41,10 +41,11 @@
#include "qdeclarativeparserstatus.h"
+#include <QtGui/qcolor.h>
#include <QtCore/qobject.h>
#include <QtCore/qsize.h>
#include <QtCore/qvariant.h>
-#include <QtOpenGL/qglfunctions.h>
+#include <QtGui/qopenglfunctions.h>
#ifndef SHADEREFFECTMESH_H
#define SHADEREFFECTMESH_H
diff --git a/src/declarative/items/qsgshadereffectnode.cpp b/src/declarative/items/qsgshadereffectnode.cpp
index d51317a122..c5d208345e 100644
--- a/src/declarative/items/qsgshadereffectnode.cpp
+++ b/src/declarative/items/qsgshadereffectnode.cpp
@@ -108,7 +108,7 @@ void QSGCustomMaterialShader::updateState(const RenderState &state, QSGMaterial
}
}
- QGLFunctions *functions = state.context()->functions();
+ QOpenGLFunctions *functions = state.context()->functions();
for (int i = material->m_textures.size() - 1; i >= 0; --i) {
functions->glActiveTexture(GL_TEXTURE0 + i);
if (QSGTextureProvider *provider = material->m_textures.at(i).second) {
diff --git a/src/declarative/items/qsgshadereffectsource.cpp b/src/declarative/items/qsgshadereffectsource.cpp
index ef6dd64532..4035608a6e 100644
--- a/src/declarative/items/qsgshadereffectsource.cpp
+++ b/src/declarative/items/qsgshadereffectsource.cpp
@@ -46,7 +46,7 @@
#include <private/qsgadaptationlayer_p.h>
#include <private/qsgrenderer_p.h>
-#include "qglframebufferobject.h"
+#include "qopenglframebufferobject.h"
#include "qmath.h"
#include <private/qsgtexture_p.h>
@@ -289,27 +289,27 @@ void QSGShaderEffectTexture::grab()
// Don't delete the FBO right away in case it is used recursively.
deleteFboLater = true;
delete m_secondaryFbo;
- QGLFramebufferObjectFormat format;
+ QOpenGLFramebufferObjectFormat format;
- format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+ format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
format.setInternalTextureFormat(m_format);
format.setSamples(8);
- m_secondaryFbo = new QGLFramebufferObject(m_size, format);
+ m_secondaryFbo = new QOpenGLFramebufferObject(m_size, format);
} else {
- QGLFramebufferObjectFormat format;
- format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+ QOpenGLFramebufferObjectFormat format;
+ format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
format.setInternalTextureFormat(m_format);
format.setMipmap(m_mipmap);
if (m_recursive) {
deleteFboLater = true;
delete m_secondaryFbo;
- m_secondaryFbo = new QGLFramebufferObject(m_size, format);
+ m_secondaryFbo = new QOpenGLFramebufferObject(m_size, format);
glBindTexture(GL_TEXTURE_2D, m_secondaryFbo->texture());
updateBindOptions(true);
} else {
delete m_fbo;
delete m_secondaryFbo;
- m_fbo = new QGLFramebufferObject(m_size, format);
+ m_fbo = new QOpenGLFramebufferObject(m_size, format);
m_secondaryFbo = 0;
glBindTexture(GL_TEXTURE_2D, m_fbo->texture());
updateBindOptions(true);
@@ -322,7 +322,7 @@ void QSGShaderEffectTexture::grab()
Q_ASSERT(m_fbo);
Q_ASSERT(!m_multisampling);
- m_secondaryFbo = new QGLFramebufferObject(m_size, m_fbo->format());
+ m_secondaryFbo = new QOpenGLFramebufferObject(m_size, m_fbo->format());
glBindTexture(GL_TEXTURE_2D, m_secondaryFbo->texture());
updateBindOptions(true);
}
@@ -347,7 +347,7 @@ void QSGShaderEffectTexture::grab()
m_dirtyTexture = false;
- const QGLContext *ctx = m_context->glContext();
+ QOpenGLContext *ctx = m_context->glContext();
m_renderer->setDeviceRect(m_size);
m_renderer->setViewportRect(m_size);
QRectF mirrored(m_rect.left(), m_rect.bottom(), m_rect.width(), -m_rect.height());
@@ -359,29 +359,29 @@ void QSGShaderEffectTexture::grab()
if (deleteFboLater) {
delete m_fbo;
- QGLFramebufferObjectFormat format;
+ QOpenGLFramebufferObjectFormat format;
format.setInternalTextureFormat(m_format);
- format.setAttachment(QGLFramebufferObject::NoAttachment);
+ format.setAttachment(QOpenGLFramebufferObject::NoAttachment);
format.setMipmap(m_mipmap);
format.setSamples(0);
- m_fbo = new QGLFramebufferObject(m_size, format);
+ m_fbo = new QOpenGLFramebufferObject(m_size, format);
glBindTexture(GL_TEXTURE_2D, m_fbo->texture());
updateBindOptions(true);
}
QRect r(QPoint(), m_size);
- QGLFramebufferObject::blitFramebuffer(m_fbo, r, m_secondaryFbo, r);
+ QOpenGLFramebufferObject::blitFramebuffer(m_fbo, r, m_secondaryFbo, r);
} else {
if (m_recursive) {
m_renderer->renderScene(QSGBindableFbo(m_secondaryFbo));
if (deleteFboLater) {
delete m_fbo;
- QGLFramebufferObjectFormat format;
- format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+ QOpenGLFramebufferObjectFormat format;
+ format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
format.setInternalTextureFormat(m_format);
format.setMipmap(m_mipmap);
- m_fbo = new QGLFramebufferObject(m_size, format);
+ m_fbo = new QOpenGLFramebufferObject(m_size, format);
glBindTexture(GL_TEXTURE_2D, m_fbo->texture());
updateBindOptions(true);
}
diff --git a/src/declarative/items/qsgshadereffectsource_p.h b/src/declarative/items/qsgshadereffectsource_p.h
index 92a4ce8a76..6cb76ddba4 100644
--- a/src/declarative/items/qsgshadereffectsource_p.h
+++ b/src/declarative/items/qsgshadereffectsource_p.h
@@ -62,7 +62,7 @@ QT_MODULE(Declarative)
class QSGNode;
class UpdatePaintNodeData;
-class QGLFramebufferObject;
+class QOpenGLFramebufferObject;
class QSGShaderEffectSourceTextureProvider;
@@ -134,8 +134,8 @@ private:
QSGItem *m_shaderSource;
QSGRenderer *m_renderer;
- QGLFramebufferObject *m_fbo;
- QGLFramebufferObject *m_secondaryFbo;
+ QOpenGLFramebufferObject *m_fbo;
+ QOpenGLFramebufferObject *m_secondaryFbo;
#ifdef QSG_DEBUG_FBO_OVERLAY
QSGRectangleNode *m_debugOverlay;
diff --git a/src/declarative/items/qsgspriteengine.cpp b/src/declarative/items/qsgspriteengine.cpp
index 1915db6000..7e6492e419 100644
--- a/src/declarative/items/qsgspriteengine.cpp
+++ b/src/declarative/items/qsgspriteengine.cpp
@@ -44,7 +44,7 @@
#include <QDebug>
#include <QPainter>
#include <QSet>
-#include <QtOpenGL>
+#include <QtGui>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/items/qsgtextnode_p.h b/src/declarative/items/qsgtextnode_p.h
index 4c5199aefa..e9b9b98edf 100644
--- a/src/declarative/items/qsgtextnode_p.h
+++ b/src/declarative/items/qsgtextnode_p.h
@@ -44,6 +44,7 @@
#include <qsgnode.h>
#include <qsgtext_p.h>
+#include <qglyphrun.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/particles/qsgimageparticle.cpp b/src/declarative/particles/qsgimageparticle.cpp
index 57461a414b..737b393de7 100644
--- a/src/declarative/particles/qsgimageparticle.cpp
+++ b/src/declarative/particles/qsgimageparticle.cpp
@@ -49,7 +49,7 @@
#include "qsgparticleemitter_p.h"
#include "qsgsprite_p.h"
#include "qsgspriteengine_p.h"
-#include <QGLFunctions>
+#include <QOpenGLFunctions>
#include <qsgengine.h>
QT_BEGIN_NAMESPACE
@@ -128,7 +128,7 @@ public:
program()->bind();
program()->setUniformValue("texture", 0);
program()->setUniformValue("colortable", 1);
- glFuncs = QGLContext::currentContext()->functions();
+ glFuncs = QOpenGLContext::currentContext()->functions();
m_timestamp_id = program()->uniformLocation("timestamp");
m_entry_id = program()->uniformLocation("entry");
m_sizetable_id = program()->uniformLocation("sizetable");
@@ -156,7 +156,7 @@ public:
int m_opacitytable_id;
QByteArray m_vertex_code;
QByteArray m_fragment_code;
- QGLFunctions* glFuncs;
+ QOpenGLFunctions* glFuncs;
};
class DeformableMaterialData : public ImageMaterialData {};
@@ -195,7 +195,7 @@ public:
QSGSimpleMaterialShader<DeformableMaterialData>::initialize();
program()->bind();
program()->setUniformValue("texture", 0);
- glFuncs = QGLContext::currentContext()->functions();
+ glFuncs = QOpenGLContext::currentContext()->functions();
m_timestamp_id = program()->uniformLocation("timestamp");
m_entry_id = program()->uniformLocation("entry");
}
@@ -212,7 +212,7 @@ public:
int m_timestamp_id;
QByteArray m_vertex_code;
QByteArray m_fragment_code;
- QGLFunctions* glFuncs;
+ QOpenGLFunctions* glFuncs;
};
class SpriteMaterialData : public ImageMaterialData {};
@@ -252,7 +252,7 @@ public:
program()->bind();
program()->setUniformValue("texture", 0);
program()->setUniformValue("colortable", 1);
- glFuncs = QGLContext::currentContext()->functions();
+ glFuncs = QOpenGLContext::currentContext()->functions();
m_timestamp_id = program()->uniformLocation("timestamp");
m_framecount_id = program()->uniformLocation("framecount");
m_animcount_id = program()->uniformLocation("animcount");
@@ -285,7 +285,7 @@ public:
int m_opacitytable_id;
QByteArray m_vertex_code;
QByteArray m_fragment_code;
- QGLFunctions* glFuncs;
+ QOpenGLFunctions* glFuncs;
};
class ColoredMaterialData : public ImageMaterialData {};
@@ -339,7 +339,7 @@ public:
QSGSimpleMaterialShader<ColoredMaterialData>::initialize();
program()->bind();
program()->setUniformValue("texture", 0);
- glFuncs = QGLContext::currentContext()->functions();
+ glFuncs = QOpenGLContext::currentContext()->functions();
m_timestamp_id = program()->uniformLocation("timestamp");
m_entry_id = program()->uniformLocation("entry");
}
@@ -356,7 +356,7 @@ public:
int m_entry_id;
QByteArray m_vertex_code;
QByteArray m_fragment_code;
- QGLFunctions* glFuncs;
+ QOpenGLFunctions* glFuncs;
};
class SimpleMaterialData : public ImageMaterialData {};
@@ -408,7 +408,7 @@ public:
QSGSimpleMaterialShader<SimpleMaterialData>::initialize();
program()->bind();
program()->setUniformValue("texture", 0);
- glFuncs = QGLContext::currentContext()->functions();
+ glFuncs = QOpenGLContext::currentContext()->functions();
m_timestamp_id = program()->uniformLocation("timestamp");
m_entry_id = program()->uniformLocation("entry");
}
@@ -425,7 +425,7 @@ public:
int m_entry_id;
QByteArray m_vertex_code;
QByteArray m_fragment_code;
- QGLFunctions* glFuncs;
+ QOpenGLFunctions* glFuncs;
};
void fillUniformArrayFromImage(float* array, const QImage& img, int size)
diff --git a/src/declarative/scenegraph/coreapi/qsggeometry.h b/src/declarative/scenegraph/coreapi/qsggeometry.h
index f99eee3c4b..107cabc506 100644
--- a/src/declarative/scenegraph/coreapi/qsggeometry.h
+++ b/src/declarative/scenegraph/coreapi/qsggeometry.h
@@ -42,7 +42,8 @@
#ifndef QSGGEOMETRY_H
#define QSGGEOMETRY_H
-#include <QtOpenGL/qgl.h>
+#include <QtGui/qopengl.h>
+#include <QRectF>
QT_BEGIN_HEADER
diff --git a/src/declarative/scenegraph/coreapi/qsgmaterial.cpp b/src/declarative/scenegraph/coreapi/qsgmaterial.cpp
index ca172d6f49..65ce9eec93 100644
--- a/src/declarative/scenegraph/coreapi/qsgmaterial.cpp
+++ b/src/declarative/scenegraph/coreapi/qsgmaterial.cpp
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
The QSGMaterial and QSGMaterialShader form a tight relationship. For one
scene graph (including nested graphs), there is one unique QSGMaterialShader
- instance which encapsulates the QGLShaderProgram the scene graph uses
+ instance which encapsulates the QOpenGLShaderProgram the scene graph uses
to render that material, such as a shader to flat coloring of geometry.
Each QSGGeometryNode can have a unique QSGMaterial containing the
how the shader should be configured when drawing that node, such as
@@ -152,7 +152,7 @@ QSGMaterialShader::QSGMaterialShader()
/*!
- \fn QGLShaderProgram *QSGMaterialShader::program() const
+ \fn QOpenGLShaderProgram *QSGMaterialShader::program() const
Returns the shader program used by this QSGMaterialShader.
*/
@@ -228,7 +228,7 @@ void QSGMaterialShader::updateState(const RenderState &state, QSGMaterial *newMa
/*!
This function is called when the shader is initialized to compile the
- actual QGLShaderProgram. Do not call it explicitely.
+ actual QOpenGLShaderProgram. Do not call it explicitely.
The default implementation will extract the vertexShader() and
fragmentShader() and bind the names returned from attributeNames()
@@ -239,8 +239,8 @@ void QSGMaterialShader::compile()
{
Q_ASSERT_X(!m_program.isLinked(), "QSGSMaterialShader::compile()", "Compile called multiple times!");
- program()->addShaderFromSourceCode(QGLShader::Vertex, vertexShader());
- program()->addShaderFromSourceCode(QGLShader::Fragment, fragmentShader());
+ program()->addShaderFromSourceCode(QOpenGLShader::Vertex, vertexShader());
+ program()->addShaderFromSourceCode(QOpenGLShader::Fragment, fragmentShader());
char const *const *attr = attributeNames();
#ifndef QT_NO_DEBUG
@@ -385,10 +385,10 @@ QRect QSGMaterialShader::RenderState::deviceRect() const
/*!
- Returns the QGLContext that is being used for rendering
+ Returns the QOpenGLContext that is being used for rendering
*/
-const QGLContext *QSGMaterialShader::RenderState::context() const
+QOpenGLContext *QSGMaterialShader::RenderState::context() const
{
return static_cast<const QSGRenderer *>(m_data)->glContext();
}
@@ -417,7 +417,7 @@ static void qt_print_material_count()
The QSGMaterial and QSGMaterialShader subclasses form a tight relationship. For
one scene graph (including nested graphs), there is one unique QSGMaterialShader
- instance which encapsulates the QGLShaderProgram the scene graph uses
+ instance which encapsulates the QOpenGLShaderProgram the scene graph uses
to render that material, such as a shader to flat coloring of geometry.
Each QSGGeometryNode can have a unique QSGMaterial containing the
how the shader should be configured when drawing that node, such as
diff --git a/src/declarative/scenegraph/coreapi/qsgmaterial.h b/src/declarative/scenegraph/coreapi/qsgmaterial.h
index 7c6935899e..084219bfba 100644
--- a/src/declarative/scenegraph/coreapi/qsgmaterial.h
+++ b/src/declarative/scenegraph/coreapi/qsgmaterial.h
@@ -42,7 +42,7 @@
#ifndef MATERIAL_H
#define MATERIAL_H
-#include <qglshaderprogram.h>
+#include <qopenglshaderprogram.h>
QT_BEGIN_HEADER
@@ -75,7 +75,7 @@ public:
QRect viewportRect() const;
QRect deviceRect() const;
- const QGLContext *context() const;
+ QOpenGLContext *context() const;
private:
friend class QSGRenderer;
@@ -91,7 +91,7 @@ public:
virtual void updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial);
virtual char const *const *attributeNames() const = 0; // Array must end with null.
- inline QGLShaderProgram *program() { return &m_program; }
+ inline QOpenGLShaderProgram *program() { return &m_program; }
protected:
@@ -104,7 +104,7 @@ protected:
virtual const char *fragmentShader() const = 0;
private:
- QGLShaderProgram m_program;
+ QOpenGLShaderProgram m_program;
void *m_reserved;
};
diff --git a/src/declarative/scenegraph/coreapi/qsgrenderer.cpp b/src/declarative/scenegraph/coreapi/qsgrenderer.cpp
index c92d943708..607c5b5b1f 100644
--- a/src/declarative/scenegraph/coreapi/qsgrenderer.cpp
+++ b/src/declarative/scenegraph/coreapi/qsgrenderer.cpp
@@ -47,8 +47,8 @@
#include "private/qsgadaptationlayer_p.h"
-#include <QGLShaderProgram>
-#include <qglframebufferobject.h>
+#include <QOpenGLShaderProgram>
+#include <qopenglframebufferobject.h>
#include <QtWidgets/qapplication.h>
#include <qdatetime.h>
@@ -81,7 +81,7 @@ void QSGBindable::reactivate() const
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
-QSGBindableFbo::QSGBindableFbo(QGLFramebufferObject *fbo) : m_fbo(fbo)
+QSGBindableFbo::QSGBindableFbo(QOpenGLFramebufferObject *fbo) : m_fbo(fbo)
{
}
@@ -209,7 +209,7 @@ void QSGRenderer::renderScene()
class B : public QSGBindable
{
public:
- void bind() const { QGLFramebufferObject::bindDefault(); }
+ void bind() const { QOpenGLFramebufferObject::bindDefault(); }
} b;
renderScene(b);
}
@@ -454,13 +454,13 @@ QSGRenderer::ClipType QSGRenderer::updateStencilClip(const QSGClipNode *clip)
} else {
if (!stencilEnabled) {
if (!m_clip_program.isLinked()) {
- m_clip_program.addShaderFromSourceCode(QGLShader::Vertex,
+ m_clip_program.addShaderFromSourceCode(QOpenGLShader::Vertex,
"attribute highp vec4 vCoord; \n"
"uniform highp mat4 matrix; \n"
"void main() { \n"
" gl_Position = matrix * vCoord; \n"
"}");
- m_clip_program.addShaderFromSourceCode(QGLShader::Fragment,
+ m_clip_program.addShaderFromSourceCode(QOpenGLShader::Fragment,
"void main() { \n"
" gl_FragColor = vec4(0.81, 0.83, 0.12, 1.0); \n" // Trolltech green ftw!
"}");
@@ -555,7 +555,7 @@ public:
~QSGRendererVBOGeometryData()
{
- QGLFunctions *func = QGLContext::currentContext()->functions();
+ QOpenGLFunctions *func = QOpenGLContext::currentContext()->functions();
if (vertexBuffer)
func->glDeleteBuffers(1, &vertexBuffer);
if (indexBuffer)
diff --git a/src/declarative/scenegraph/coreapi/qsgrenderer_p.h b/src/declarative/scenegraph/coreapi/qsgrenderer_p.h
index 842286b47c..eed6483cdb 100644
--- a/src/declarative/scenegraph/coreapi/qsgrenderer_p.h
+++ b/src/declarative/scenegraph/coreapi/qsgrenderer_p.h
@@ -45,8 +45,9 @@
#include <qset.h>
#include <qhash.h>
-#include <qglfunctions.h>
-#include <qglshaderprogram.h>
+#include <qcolor.h>
+#include <qopenglfunctions.h>
+#include <qopenglshaderprogram.h>
#include "qsgnode.h"
#include "qsgmaterial.h"
@@ -62,13 +63,12 @@ QT_MODULE(Declarative)
class QSGMaterialShader;
struct QSGMaterialType;
-class QGLFramebufferObject;
+class QOpenGLFramebufferObject;
class TextureReference;
class QSGBindable;
class QSGNodeUpdater;
-
-class Q_DECLARATIVE_EXPORT QSGRenderer : public QObject, public QGLFunctions
+class Q_DECLARATIVE_EXPORT QSGRenderer : public QObject, public QOpenGLFunctions
{
Q_OBJECT
public:
@@ -116,7 +116,7 @@ public:
void setClearColor(const QColor &color);
QColor clearColor() const { return m_clear_color; }
- const QGLContext *glContext() const { Q_ASSERT(m_context); return m_context->glContext(); }
+ QOpenGLContext *glContext() const { Q_ASSERT(m_context); return m_context->glContext(); }
QSGContext *context();
@@ -168,7 +168,7 @@ private:
QSet<QSGNode *> m_nodes_to_preprocess;
QMatrix4x4 m_projection_matrix;
- QGLShaderProgram m_clip_program;
+ QOpenGLShaderProgram m_clip_program;
int m_clip_matrix_id;
const QSGBindable *m_bindable;
@@ -195,10 +195,10 @@ public:
class QSGBindableFbo : public QSGBindable
{
public:
- QSGBindableFbo(QGLFramebufferObject *fbo);
+ QSGBindableFbo(QOpenGLFramebufferObject *fbo);
virtual void bind() const;
private:
- QGLFramebufferObject *m_fbo;
+ QOpenGLFramebufferObject *m_fbo;
};
diff --git a/src/declarative/scenegraph/qsgadaptationlayer_p.h b/src/declarative/scenegraph/qsgadaptationlayer_p.h
index f2c0cbe9ef..f1e9a89f43 100644
--- a/src/declarative/scenegraph/qsgadaptationlayer_p.h
+++ b/src/declarative/scenegraph/qsgadaptationlayer_p.h
@@ -47,6 +47,7 @@
#include <private/qsgtext_p.h>
#include <QtCore/qobject.h>
#include <QtCore/qrect.h>
+#include <QtGui/qbrush.h>
#include <QtGui/qcolor.h>
#include <QtCore/qsharedpointer.h>
#include <QtGui/qglyphrun.h>
diff --git a/src/declarative/scenegraph/qsgcontext.cpp b/src/declarative/scenegraph/qsgcontext.cpp
index 2a9e007264..c472ed1260 100644
--- a/src/declarative/scenegraph/qsgcontext.cpp
+++ b/src/declarative/scenegraph/qsgcontext.cpp
@@ -55,7 +55,7 @@
#include <qsgengine.h>
#include <QApplication>
-#include <QGLContext>
+#include <QOpenGLContext>
#include <private/qobject_p.h>
#include <qmutex.h>
@@ -105,7 +105,7 @@ public:
QSGRootNode *rootNode;
QSGRenderer *renderer;
- QGLContext *gl;
+ QOpenGLContext *gl;
QSGEngine engine;
@@ -127,7 +127,7 @@ public:
\brief The QSGContext holds the scene graph entry points for one QML engine.
- The context is not ready for use until it has a QGLContext. Once that happens,
+ The context is not ready for use until it has a QOpenGLContext. Once that happens,
the scene graph population can start.
\internal
@@ -214,7 +214,7 @@ QSGRootNode *QSGContext::rootNode() const
}
-QGLContext *QSGContext::glContext() const
+QOpenGLContext *QSGContext::glContext() const
{
Q_D(const QSGContext);
return d->gl;
@@ -224,7 +224,7 @@ QGLContext *QSGContext::glContext() const
Initializes the scene graph context with the GL context \a context. This also
emits the ready() signal so that the QML graph can start building scene graph nodes.
*/
-void QSGContext::initialize(QGLContext *context)
+void QSGContext::initialize(QOpenGLContext *context)
{
Q_D(QSGContext);
@@ -253,7 +253,7 @@ bool QSGContext::isReady() const
}
-void QSGContext::renderNextFrame(QGLFramebufferObject *fbo)
+void QSGContext::renderNextFrame(QOpenGLFramebufferObject *fbo)
{
Q_D(QSGContext);
diff --git a/src/declarative/scenegraph/qsgcontext_p.h b/src/declarative/scenegraph/qsgcontext_p.h
index 29a5aac4b9..a05854ebe8 100644
--- a/src/declarative/scenegraph/qsgcontext_p.h
+++ b/src/declarative/scenegraph/qsgcontext_p.h
@@ -42,6 +42,7 @@
#ifndef QSGCONTEXT_H
#define QSGCONTEXT_H
+#include <QImage>
#include <QObject>
#include <qabstractanimation.h>
@@ -64,8 +65,8 @@ class QSGMaterial;
class QSGMaterialShader;
class QSGEngine;
-class QGLContext;
-class QGLFramebufferObject;
+class QOpenGLContext;
+class QOpenGLFramebufferObject;
class Q_DECLARATIVE_EXPORT QSGContext : public QObject
{
@@ -76,7 +77,7 @@ public:
explicit QSGContext(QObject *parent = 0);
~QSGContext();
- virtual void initialize(QGLContext *context);
+ virtual void initialize(QOpenGLContext *context);
QSGRenderer *renderer() const;
@@ -84,13 +85,13 @@ public:
QSGRootNode *rootNode() const;
QSGEngine *engine() const;
- QGLContext *glContext() const;
+ QOpenGLContext *glContext() const;
bool isReady() const;
QSGMaterialShader *prepareMaterial(QSGMaterial *material);
- virtual void renderNextFrame(QGLFramebufferObject *fbo = 0);
+ virtual void renderNextFrame(QOpenGLFramebufferObject *fbo = 0);
virtual QSGRectangleNode *createRectangleNode();
virtual QSGImageNode *createImageNode();
diff --git a/src/declarative/scenegraph/qsgdefaultglyphnode.cpp b/src/declarative/scenegraph/qsgdefaultglyphnode.cpp
index 3e8510e943..b8cd247908 100644
--- a/src/declarative/scenegraph/qsgdefaultglyphnode.cpp
+++ b/src/declarative/scenegraph/qsgdefaultglyphnode.cpp
@@ -42,7 +42,7 @@
#include "qsgdefaultglyphnode_p.h"
#include "qsgdefaultglyphnode_p_p.h"
-#include <qglshaderprogram.h>
+#include <qopenglshaderprogram.h>
#include <private/qfont_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/scenegraph/qsgdefaultglyphnode_p.cpp b/src/declarative/scenegraph/qsgdefaultglyphnode_p.cpp
index b00c6f0937..db2b59f757 100644
--- a/src/declarative/scenegraph/qsgdefaultglyphnode_p.cpp
+++ b/src/declarative/scenegraph/qsgdefaultglyphnode_p.cpp
@@ -41,11 +41,11 @@
#include "qsgdefaultglyphnode_p_p.h"
-#include <qglshaderprogram.h>
+#include <qopenglshaderprogram.h>
-#include <private/qtextureglyphcache_gl_p.h>
+#include <QtGui/private/qtextureglyphcache_gl_p.h>
#include <private/qfontengine_p.h>
-#include <private/qglextensions_p.h>
+#include <private/qopenglextensions_p.h>
#include <private/qsgtexture_p.h>
@@ -163,24 +163,17 @@ void QSGTextMaskMaterial::init()
QFontEngineGlyphCache::Type type = QFontEngineGlyphCache::Raster_A8;
setFlag(Blending, true);
- QGLContext *ctx = const_cast<QGLContext *>(QGLContext::currentContext());
+ QOpenGLContext *ctx = const_cast<QOpenGLContext *>(QOpenGLContext::currentContext());
Q_ASSERT(ctx != 0);
QRawFontPrivate *fontD = QRawFontPrivate::get(m_font);
if (fontD->fontEngine != 0) {
m_glyphCache = fontD->fontEngine->glyphCache(ctx, type, QTransform());
if (!m_glyphCache || m_glyphCache->cacheType() != type) {
- m_glyphCache = new QGLTextureGlyphCache(ctx, type, QTransform());
+ m_glyphCache = new QOpenGLTextureGlyphCache(type, QTransform());
fontD->fontEngine->setGlyphCache(ctx, m_glyphCache.data());
}
}
-
-#if !defined(QT_OPENGL_ES_2)
- bool success = qt_resolve_version_2_0_functions(ctx)
- && qt_resolve_buffer_extensions(ctx);
- Q_ASSERT(success);
- Q_UNUSED(success);
-#endif
}
void QSGTextMaskMaterial::populate(const QPointF &p,
@@ -260,9 +253,9 @@ QSGMaterialType *QSGTextMaskMaterial::type() const
return &type;
}
-QGLTextureGlyphCache *QSGTextMaskMaterial::glyphCache() const
+QOpenGLTextureGlyphCache *QSGTextMaskMaterial::glyphCache() const
{
- return static_cast<QGLTextureGlyphCache*>(m_glyphCache.data());
+ return static_cast<QOpenGLTextureGlyphCache*>(m_glyphCache.data());
}
QSGMaterialShader *QSGTextMaskMaterial::createShader() const
diff --git a/src/declarative/scenegraph/qsgdefaultglyphnode_p_p.h b/src/declarative/scenegraph/qsgdefaultglyphnode_p_p.h
index 19d5f9e6a6..d22bc33fea 100644
--- a/src/declarative/scenegraph/qsgdefaultglyphnode_p_p.h
+++ b/src/declarative/scenegraph/qsgdefaultglyphnode_p_p.h
@@ -42,6 +42,7 @@
#ifndef TEXTMASKMATERIAL_H
#define TEXTMASKMATERIAL_H
+#include <qcolor.h>
#include <qsgmaterial.h>
#include <qsgtexture.h>
#include <qsggeometry.h>
@@ -52,7 +53,7 @@
QT_BEGIN_NAMESPACE
class QFontEngineGlyphCache;
-class QGLTextureGlyphCache;
+class QOpenGLTextureGlyphCache;
class QFontEngine;
class Geometry;
class QSGTextMaskMaterial: public QSGMaterial
@@ -75,7 +76,7 @@ public:
bool ensureUpToDate();
- QGLTextureGlyphCache *glyphCache() const;
+ QOpenGLTextureGlyphCache *glyphCache() const;
void populate(const QPointF &position,
const QVector<quint32> &glyphIndexes, const QVector<QPointF> &glyphPositions,
QSGGeometry *geometry, QRectF *boundingRect, QPointF *baseLine);
diff --git a/src/declarative/scenegraph/qsgdefaultimagenode.cpp b/src/declarative/scenegraph/qsgdefaultimagenode.cpp
index e60ebf2b84..657f8d0e7c 100644
--- a/src/declarative/scenegraph/qsgdefaultimagenode.cpp
+++ b/src/declarative/scenegraph/qsgdefaultimagenode.cpp
@@ -45,7 +45,7 @@
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qmath.h>
-#include <QtOpenGL/qglfunctions.h>
+#include <QtGui/qopenglfunctions.h>
QT_BEGIN_NAMESPACE
@@ -194,8 +194,8 @@ void QSGDefaultImageNode::updateGeometry()
bool isRepeating = hCells > 1 || vCells > 1;
#ifdef QT_OPENGL_ES_2
- const QGLContext *ctx = QGLContext::currentContext();
- bool npotSupported = ctx->functions()->hasOpenGLFeature(QGLFunctions::NPOTTextures);
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ bool npotSupported = ctx->functions()->hasOpenGLFeature(QOpenGLFunctions::NPOTTextures);
QSize size = t->textureSize();
bool isNpot = !isPowerOfTwo(size.width()) || !isPowerOfTwo(size.height());
diff --git a/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp b/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp
index ff4913a7b5..d1973d4f36 100644
--- a/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp
+++ b/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp
@@ -44,14 +44,15 @@
#include <qmath.h>
#include <private/qsgpathsimplifier_p.h>
#include <private/qdeclarativeglobal_p.h>
-#include <qglshaderprogram.h>
-#include <private/qglengineshadersource_p.h>
+#include <qopenglshaderprogram.h>
+#include <QtGui/private/qopenglengineshadersource_p.h>
#include <private/qsgcontext_p.h>
#include <private/qrawfont_p.h>
-#include <qglfunctions.h>
+#include <qopenglfunctions.h>
#include <qglyphrun.h>
#include <qrawfont.h>
#include <qdir.h>
+#include <QtGui/qguiapplication.h>
QT_BEGIN_NAMESPACE
@@ -797,9 +798,8 @@ static bool fontHasNarrowOutlines(const QRawFont &f)
return minHThick == 1 || minVThick == 1;
}
-QSGDistanceFieldGlyphCacheManager::QSGDistanceFieldGlyphCacheManager(const QGLContext *c)
- : ctx(c)
- , m_threshold_func(defaultThresholdFunc)
+QSGDistanceFieldGlyphCacheManager::QSGDistanceFieldGlyphCacheManager(QOpenGLContext *c)
+ : m_threshold_func(defaultThresholdFunc)
, m_antialiasingSpread_func(defaultAntialiasingSpreadFunc)
, m_maxTextureSize(0)
{
@@ -827,23 +827,23 @@ QSGDistanceFieldGlyphCacheManager::QSGDistanceFieldGlyphCacheManager(const QGLCo
m_textureCoordinateArray[6] = 0.0f;
m_textureCoordinateArray[7] = 1.0f;
- m_blitProgram = new QGLShaderProgram;
+ m_blitProgram = new QOpenGLShaderProgram;
{
QString source;
- source.append(QLatin1String(qglslMainWithTexCoordsVertexShader));
- source.append(QLatin1String(qglslUntransformedPositionVertexShader));
+ source.append(QLatin1String(qopenglslMainWithTexCoordsVertexShader));
+ source.append(QLatin1String(qopenglslUntransformedPositionVertexShader));
- QGLShader *vertexShader = new QGLShader(QGLShader::Vertex, m_blitProgram);
+ QOpenGLShader *vertexShader = new QOpenGLShader(QOpenGLShader::Vertex, m_blitProgram);
vertexShader->compileSourceCode(source);
m_blitProgram->addShader(vertexShader);
}
{
QString source;
- source.append(QLatin1String(qglslMainFragmentShader));
- source.append(QLatin1String(qglslImageSrcFragmentShader));
+ source.append(QLatin1String(qopenglslMainFragmentShader));
+ source.append(QLatin1String(qopenglslImageSrcFragmentShader));
- QGLShader *fragmentShader = new QGLShader(QGLShader::Fragment, m_blitProgram);
+ QOpenGLShader *fragmentShader = new QOpenGLShader(QOpenGLShader::Fragment, m_blitProgram);
fragmentShader->compileSourceCode(source);
m_blitProgram->addShader(fragmentShader);
@@ -876,7 +876,7 @@ int QSGDistanceFieldGlyphCacheManager::maxTextureSize() const
}
-QHash<QString, QGLContextGroupResource<QSGDistanceFieldGlyphCache::DistanceFieldTextureData> > QSGDistanceFieldGlyphCache::m_textures_data;
+QHash<QString, QOpenGLMultiGroupSharedResource> QSGDistanceFieldGlyphCache::m_textures_data;
QSGDistanceFieldGlyphCache::DistanceFieldTextureData *QSGDistanceFieldGlyphCache::textureData()
{
@@ -885,10 +885,10 @@ QSGDistanceFieldGlyphCache::DistanceFieldTextureData *QSGDistanceFieldGlyphCache
.arg(m_font.styleName())
.arg(m_font.weight())
.arg(m_font.style());
- return m_textures_data[key].value(ctx);
+ return m_textures_data[key].value<QSGDistanceFieldGlyphCache::DistanceFieldTextureData>(QOpenGLContext::currentContext());
}
-QSGDistanceFieldGlyphCache::QSGDistanceFieldGlyphCache(QSGDistanceFieldGlyphCacheManager *man, const QGLContext *c, const QRawFont &font)
+QSGDistanceFieldGlyphCache::QSGDistanceFieldGlyphCache(QSGDistanceFieldGlyphCacheManager *man, QOpenGLContext *c, const QRawFont &font)
: m_manager(man)
, ctx(c)
{
@@ -1045,7 +1045,7 @@ void QSGDistanceFieldGlyphCache::derefGlyphs(int count, const glyph_t *glyphs)
void QSGDistanceFieldGlyphCache::createTexture(int width, int height)
{
- if (ctx->d_ptr->workaround_brokenFBOReadBack && m_textureData->image.isNull())
+ if (ctx->d_func()->workaround_brokenFBOReadBack && m_textureData->image.isNull())
m_textureData->image = QImage(width, height, QImage::Format_Indexed8);
while (glGetError() != GL_NO_ERROR) { }
@@ -1083,7 +1083,7 @@ void QSGDistanceFieldGlyphCache::resizeTexture(int width, int height)
if (!oldTexture)
return;
- if (ctx->d_ptr->workaround_brokenFBOReadBack) {
+ if (ctx->d_func()->workaround_brokenFBOReadBack) {
m_textureData->image = m_textureData->image.copy(0, 0, width, height);
QImage copy = m_textureData->image.copy(0, 0, oldWidth, oldHeight);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, oldWidth, oldHeight, GL_ALPHA, GL_UNSIGNED_BYTE, copy.constBits());
@@ -1093,7 +1093,7 @@ void QSGDistanceFieldGlyphCache::resizeTexture(int width, int height)
if (!m_textureData->fbo)
ctx->functions()->glGenFramebuffers(1, &m_textureData->fbo);
- ctx->functions()->glBindFramebuffer(GL_FRAMEBUFFER_EXT, m_textureData->fbo);
+ ctx->functions()->glBindFramebuffer(GL_FRAMEBUFFER, m_textureData->fbo);
GLuint tmp_texture;
glGenTextures(1, &tmp_texture);
@@ -1105,7 +1105,7 @@ void QSGDistanceFieldGlyphCache::resizeTexture(int width, int height)
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glBindTexture(GL_TEXTURE_2D, 0);
- ctx->functions()->glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+ ctx->functions()->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, tmp_texture, 0);
ctx->functions()->glActiveTexture(GL_TEXTURE0);
@@ -1145,12 +1145,12 @@ void QSGDistanceFieldGlyphCache::resizeTexture(int width, int height)
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, oldWidth, oldHeight);
- ctx->functions()->glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
- GL_RENDERBUFFER_EXT, 0);
+ ctx->functions()->glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ GL_RENDERBUFFER, 0);
glDeleteTextures(1, &tmp_texture);
glDeleteTextures(1, &oldTexture);
- ctx->functions()->glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
+ ctx->functions()->glBindFramebuffer(GL_FRAMEBUFFER, 0);
// restore render states
if (stencilTestEnabled)
@@ -1177,7 +1177,7 @@ void QSGDistanceFieldGlyphCache::updateCache()
glBindTexture(GL_TEXTURE_2D, m_textureData->texture);
// ### Remove before final release
- static bool cacheDistanceFields = QApplication::arguments().contains("--cache-distance-fields");
+ static bool cacheDistanceFields = QGuiApplication::arguments().contains("--cache-distance-fields");
// #define QSGDISTANCEFIELDS_TIME_CREATION
#ifdef QSGDISTANCEFIELDS_TIME_CREATION
@@ -1214,7 +1214,7 @@ void QSGDistanceFieldGlyphCache::updateCache()
QImage glyph = renderDistanceFieldGlyph(glyphIndex);
- if (ctx->d_ptr->workaround_brokenFBOReadBack) {
+ if (ctx->d_func()->workaround_brokenFBOReadBack) {
uchar *inBits = glyph.scanLine(0);
uchar *outBits = m_textureData->image.scanLine(int(c.y)) + int(c.x);
for (int y = 0; y < glyph.height(); ++y) {
@@ -1245,7 +1245,7 @@ void QSGDistanceFieldGlyphCache::updateCache()
bool QSGDistanceFieldGlyphCache::useWorkaroundBrokenFBOReadback() const
{
- return ctx->d_ptr->workaround_brokenFBOReadBack;
+ return ctx->d_func()->workaround_brokenFBOReadBack;
}
int QSGDistanceFieldGlyphCache::glyphCount() const
diff --git a/src/declarative/scenegraph/qsgdistancefieldglyphcache_p.h b/src/declarative/scenegraph/qsgdistancefieldglyphcache_p.h
index c4dd97bab5..aea7c5952f 100644
--- a/src/declarative/scenegraph/qsgdistancefieldglyphcache_p.h
+++ b/src/declarative/scenegraph/qsgdistancefieldglyphcache_p.h
@@ -42,9 +42,10 @@
#ifndef DISTANCEFIELDGLYPHCACHE_H
#define DISTANCEFIELDGLYPHCACHE_H
-#include <qgl.h>
+#include <qopengl.h>
#include <qrawfont.h>
-#include <private/qgl_p.h>
+#include <private/qopenglcontext_p.h>
+#include <QtGui/qopenglfunctions.h>
#include <private/qfont_p.h>
#include <private/qfontengine_p.h>
#include <QtGui/private/qdatabuffer_p.h>
@@ -55,13 +56,13 @@ QT_BEGIN_NAMESPACE
typedef float (*ThresholdFunc)(float glyphScale);
typedef float (*AntialiasingSpreadFunc)(float glyphScale);
-class QGLShaderProgram;
+class QOpenGLShaderProgram;
class QSGDistanceFieldGlyphCache;
class Q_DECLARATIVE_EXPORT QSGDistanceFieldGlyphCacheManager
{
public:
- QSGDistanceFieldGlyphCacheManager(const QGLContext *c);
+ QSGDistanceFieldGlyphCacheManager(QOpenGLContext *c);
~QSGDistanceFieldGlyphCacheManager();
QSGDistanceFieldGlyphCache *cache(const QRawFont &font);
@@ -75,7 +76,7 @@ public:
AntialiasingSpreadFunc antialiasingSpreadFunc() const { return m_antialiasingSpread_func; }
void setAntialiasingSpreadFunc(AntialiasingSpreadFunc func) { m_antialiasingSpread_func = func; }
- QGLShaderProgram *blitProgram() { return m_blitProgram; }
+ QOpenGLShaderProgram *blitProgram() { return m_blitProgram; }
const GLfloat *blitVertexArray() const { return &m_vertexCoordinateArray[0]; }
const GLfloat *blitTextureArray() const { return &m_textureCoordinateArray[0]; }
@@ -84,7 +85,7 @@ public:
private:
QHash<QFontEngine *, QSGDistanceFieldGlyphCache *> m_caches;
- const QGLContext *ctx;
+ QOpenGLContext *ctx;
QSGGlyphNode::AntialiasingMode m_defaultAntialiasingMode;
ThresholdFunc m_threshold_func;
@@ -92,7 +93,7 @@ private:
mutable int m_maxTextureSize;
- QGLShaderProgram *m_blitProgram;
+ QOpenGLShaderProgram *m_blitProgram;
GLfloat m_vertexCoordinateArray[8];
GLfloat m_textureCoordinateArray[8];
};
@@ -145,20 +146,22 @@ public:
bool useWorkaroundBrokenFBOReadback() const;
private:
- QSGDistanceFieldGlyphCache(QSGDistanceFieldGlyphCacheManager *man, const QGLContext *c, const QRawFont &font);
+ QSGDistanceFieldGlyphCache(QSGDistanceFieldGlyphCacheManager *man, QOpenGLContext *c, const QRawFont &font);
void createTexture(int width, int height);
void resizeTexture(int width, int height);
QSGDistanceFieldGlyphCacheManager *m_manager;
+ QOpenGLContext *ctx;
+
QRawFont m_font;
QRawFont m_referenceFont;
int m_glyphCount;
QHash<glyph_t, Metrics> m_metrics;
- struct DistanceFieldTextureData {
+ struct DistanceFieldTextureData : public QOpenGLSharedResource {
GLuint texture;
GLuint fbo;
QSize size;
@@ -171,20 +174,33 @@ private:
QImage image;
bool doubleGlyphResolution;
- DistanceFieldTextureData(const QGLContext *)
- : texture(0)
+ DistanceFieldTextureData(QOpenGLContext *ctx)
+ : QOpenGLSharedResource(ctx->shareGroup())
+ , texture(0)
, fbo(0)
, pendingGlyphs(64)
, currX(0)
, currY(0)
, doubleGlyphResolution(false)
- { }
+ {}
+
+ void invalidateResource()
+ {
+ texture = 0;
+ fbo = 0;
+ size = QSize();
+ }
+
+ void freeResource(QOpenGLContext *ctx)
+ {
+ glDeleteTextures(1, &texture);
+ ctx->functions()->glDeleteFramebuffers(1, &fbo);
+ }
};
+
DistanceFieldTextureData *textureData();
DistanceFieldTextureData *m_textureData;
- static QHash<QString, QGLContextGroupResource<DistanceFieldTextureData> > m_textures_data;
-
- const QGLContext *ctx;
+ static QHash<QString, QOpenGLMultiGroupSharedResource> m_textures_data;
friend class QSGDistanceFieldGlyphCacheManager;
};
diff --git a/src/declarative/scenegraph/qsgdistancefieldglyphnode_p.cpp b/src/declarative/scenegraph/qsgdistancefieldglyphnode_p.cpp
index c81113f4dc..72c53a2ce7 100644
--- a/src/declarative/scenegraph/qsgdistancefieldglyphnode_p.cpp
+++ b/src/declarative/scenegraph/qsgdistancefieldglyphnode_p.cpp
@@ -42,7 +42,7 @@
#include "qsgdistancefieldglyphnode_p_p.h"
#include "qsgdistancefieldglyphcache_p.h"
#include <private/qsgtexture_p.h>
-#include <QtOpenGL/qglfunctions.h>
+#include <QtGui/qopenglfunctions.h>
#include <qmath.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/scenegraph/qsgpathsimplifier.cpp b/src/declarative/scenegraph/qsgpathsimplifier.cpp
index 5fac564e21..9e851bf434 100644
--- a/src/declarative/scenegraph/qsgpathsimplifier.cpp
+++ b/src/declarative/scenegraph/qsgpathsimplifier.cpp
@@ -48,7 +48,7 @@
#include <math.h>
-#include <private/qgl_p.h>
+#include <private/qopengl_p.h>
#include <private/qrbtree_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/scenegraph/scenegraph.pri b/src/declarative/scenegraph/scenegraph.pri
index 6fea47be05..b628a4708d 100644
--- a/src/declarative/scenegraph/scenegraph.pri
+++ b/src/declarative/scenegraph/scenegraph.pri
@@ -1,9 +1,6 @@
INCLUDEPATH += $$PWD/coreapi $$PWD/convenience $$PWD/3d
!contains(QT_CONFIG, egl):DEFINES += QT_NO_EGL
-QT += opengl
-
-
# Core API
HEADERS += \
$$PWD/coreapi/qsgdefaultrenderer_p.h \
diff --git a/src/declarative/scenegraph/util/qsgflatcolormaterial.cpp b/src/declarative/scenegraph/util/qsgflatcolormaterial.cpp
index d954f196ab..06ca28aff5 100644
--- a/src/declarative/scenegraph/util/qsgflatcolormaterial.cpp
+++ b/src/declarative/scenegraph/util/qsgflatcolormaterial.cpp
@@ -41,7 +41,7 @@
#include "qsgflatcolormaterial.h"
-#include <qglshaderprogram.h>
+#include <qopenglshaderprogram.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/scenegraph/util/qsgflatcolormaterial.h b/src/declarative/scenegraph/util/qsgflatcolormaterial.h
index ffff7941a3..fb0411089a 100644
--- a/src/declarative/scenegraph/util/qsgflatcolormaterial.h
+++ b/src/declarative/scenegraph/util/qsgflatcolormaterial.h
@@ -43,6 +43,7 @@
#define FLATCOLORMATERIAL_H
#include <qsgmaterial.h>
+#include <qcolor.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/scenegraph/util/qsgpainternode.cpp b/src/declarative/scenegraph/util/qsgpainternode.cpp
index ab96591b76..9a02d8bedd 100644
--- a/src/declarative/scenegraph/util/qsgpainternode.cpp
+++ b/src/declarative/scenegraph/util/qsgpainternode.cpp
@@ -43,9 +43,10 @@
#include "qsgpainteditem.h"
#include <private/qsgcontext_p.h>
-#include <qglframebufferobject.h>
-#include <qglfunctions.h>
+#include <qopenglframebufferobject.h>
+#include <qopenglfunctions.h>
#include <qmath.h>
+#include <qpainter.h>
QT_BEGIN_NAMESPACE
@@ -90,7 +91,7 @@ void QSGPainterTexture::bind()
#endif
if (m_has_mipmaps && !m_mipmaps_generated) {
- const QGLContext *ctx = QGLContext::currentContext();
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
ctx->functions()->glGenerateMipmap(GL_TEXTURE_2D);
m_mipmaps_generated = true;
}
@@ -174,7 +175,7 @@ void QSGPainterNode::paint()
m_texture->setImage(m_image);
m_texture->setDirtyRect(dirtyRect);
} else if (m_multisampledFbo) {
- QGLFramebufferObject::blitFramebuffer(m_fbo, dirtyRect, m_multisampledFbo, dirtyRect);
+ QOpenGLFramebufferObject::blitFramebuffer(m_fbo, dirtyRect, m_multisampledFbo, dirtyRect);
}
m_dirtyRect = QRect();
@@ -249,8 +250,8 @@ void QSGPainterNode::updateRenderTarget()
}
if (m_actualRenderTarget == QSGPaintedItem::FramebufferObject) {
- const QGLContext *ctx = QGLContext::currentContext();
- if (m_fbo && !m_dirtyGeometry && (!ctx->format().sampleBuffers() || !m_multisamplingSupported))
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ if (m_fbo && !m_dirtyGeometry && (!ctx->format().samples() || !m_multisamplingSupported))
return;
if (m_fboSize.isEmpty())
@@ -260,22 +261,22 @@ void QSGPainterNode::updateRenderTarget()
delete m_multisampledFbo;
m_fbo = m_multisampledFbo = 0;
- if (m_smoothPainting && ctx->format().sampleBuffers() && m_multisamplingSupported) {
+ if (m_smoothPainting && ctx->format().samples() && m_multisamplingSupported) {
{
- QGLFramebufferObjectFormat format;
- format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+ QOpenGLFramebufferObjectFormat format;
+ format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
format.setSamples(ctx->format().samples());
- m_multisampledFbo = new QGLFramebufferObject(m_fboSize, format);
+ m_multisampledFbo = new QOpenGLFramebufferObject(m_fboSize, format);
}
{
- QGLFramebufferObjectFormat format;
- format.setAttachment(QGLFramebufferObject::NoAttachment);
- m_fbo = new QGLFramebufferObject(m_fboSize, format);
+ QOpenGLFramebufferObjectFormat format;
+ format.setAttachment(QOpenGLFramebufferObject::NoAttachment);
+ m_fbo = new QOpenGLFramebufferObject(m_fboSize, format);
}
} else {
- QGLFramebufferObjectFormat format;
- format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
- m_fbo = new QGLFramebufferObject(m_fboSize, format);
+ QOpenGLFramebufferObjectFormat format;
+ format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
+ m_fbo = new QOpenGLFramebufferObject(m_fboSize, format);
}
} else {
if (!m_image.isNull() && !m_dirtyGeometry)
diff --git a/src/declarative/scenegraph/util/qsgpainternode_p.h b/src/declarative/scenegraph/util/qsgpainternode_p.h
index 5b0e9cef2c..50fb521405 100644
--- a/src/declarative/scenegraph/util/qsgpainternode_p.h
+++ b/src/declarative/scenegraph/util/qsgpainternode_p.h
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class QGLFramebufferObject;
+class QOpenGLFramebufferObject;
class Q_DECLARATIVE_EXPORT QSGPainterTexture : public QSGPlainTexture
{
@@ -115,8 +115,8 @@ private:
QSGPaintedItem *m_item;
- QGLFramebufferObject *m_fbo;
- QGLFramebufferObject *m_multisampledFbo;
+ QOpenGLFramebufferObject *m_fbo;
+ QOpenGLFramebufferObject *m_multisampledFbo;
QImage m_image;
QSGOpaqueTextureMaterial m_material;
diff --git a/src/declarative/scenegraph/util/qsgtexture.cpp b/src/declarative/scenegraph/util/qsgtexture.cpp
index 536ac8d7fe..d403bd6503 100644
--- a/src/declarative/scenegraph/util/qsgtexture.cpp
+++ b/src/declarative/scenegraph/util/qsgtexture.cpp
@@ -42,7 +42,7 @@
#define GL_GLEXT_PROTOTYPES
#include <private/qsgtexture_p.h>
-#include <qglfunctions.h>
+#include <qopenglfunctions.h>
#include <private/qsgcontext_p.h>
#include <qthread.h>
@@ -260,7 +260,7 @@ void QSGTexture::updateBindOptions(bool force)
if (force || d->wrapChanged) {
#if !defined(QT_NO_DEBUG) && defined(QT_OPENGL_ES_2)
if (d->horizontalWrap == Repeat || d->verticalWrap == Repeat) {
- bool npotSupported = QGLContext::currentContext()->functions()->hasOpenGLFeature(QGLFunctions::NPOTTextures);
+ bool npotSupported = QOpenGLFunctions(QOpenGLContext::currentContext()).hasOpenGLFeature(QOpenGLFunctions::NPOTTextures);
QSize size = textureSize();
bool isNpot = !isPowerOfTwo(size.width()) || !isPowerOfTwo(size.height());
if (!npotSupported && isNpot)
@@ -341,7 +341,7 @@ void QSGPlainTexture::bind()
if (!m_dirty_texture) {
glBindTexture(GL_TEXTURE_2D, m_texture_id);
if (m_has_mipmaps && !m_mipmaps_generated) {
- const QGLContext *ctx = QGLContext::currentContext();
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
ctx->functions()->glGenerateMipmap(GL_TEXTURE_2D);
m_mipmaps_generated = true;
}
@@ -377,7 +377,7 @@ void QSGPlainTexture::bind()
#endif
if (m_has_mipmaps) {
- const QGLContext *ctx = QGLContext::currentContext();
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
ctx->functions()->glGenerateMipmap(GL_TEXTURE_2D);
m_mipmaps_generated = true;
}
diff --git a/src/declarative/scenegraph/util/qsgtexture_p.h b/src/declarative/scenegraph/util/qsgtexture_p.h
index 971e5e686c..22812f8640 100644
--- a/src/declarative/scenegraph/util/qsgtexture_p.h
+++ b/src/declarative/scenegraph/util/qsgtexture_p.h
@@ -44,7 +44,7 @@
#include <private/qobject_p.h>
-#include <QtOpenGL/qgl.h>
+#include <QtGui/qopengl.h>
#include "qsgtexture.h"
#include <private/qsgcontext_p.h>
diff --git a/src/declarative/scenegraph/util/qsgtexturematerial.cpp b/src/declarative/scenegraph/util/qsgtexturematerial.cpp
index 7a7050e073..43bfbcad57 100644
--- a/src/declarative/scenegraph/util/qsgtexturematerial.cpp
+++ b/src/declarative/scenegraph/util/qsgtexturematerial.cpp
@@ -41,8 +41,8 @@
#include "qsgtexturematerial_p.h"
-#include <QtOpenGL/qglshaderprogram.h>
-#include <QtOpenGL/qglfunctions.h>
+#include <QtGui/qopenglshaderprogram.h>
+#include <QtGui/qopenglfunctions.h>
QT_BEGIN_NAMESPACE
@@ -103,7 +103,7 @@ void QSGOpaqueTextureMaterialShader::updateState(const RenderState &state, QSGMa
t->setFiltering(tx->filtering());
#ifdef QT_OPENGL_ES_2
- bool npotSupported = state.context()->functions()->hasOpenGLFeature(QGLFunctions::NPOTTextures);
+ bool npotSupported = QOpenGLFunctions(const_cast<QOpenGLContext *>(state.context())).hasOpenGLFeature(QOpenGLFunctions::NPOTTextures);
QSize size = t->textureSize();
bool isNpot = !isPowerOfTwo(size.width()) || !isPowerOfTwo(size.height());
if (!npotSupported && isNpot) {
diff --git a/src/declarative/scenegraph/util/qsgvertexcolormaterial.cpp b/src/declarative/scenegraph/util/qsgvertexcolormaterial.cpp
index 910d7a53f8..c31e9dc936 100644
--- a/src/declarative/scenegraph/util/qsgvertexcolormaterial.cpp
+++ b/src/declarative/scenegraph/util/qsgvertexcolormaterial.cpp
@@ -41,7 +41,7 @@
#include "qsgvertexcolormaterial_p.h"
-#include <qglshaderprogram.h>
+#include <qopenglshaderprogram.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index 108d2579ac..276219eb45 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -66,6 +66,7 @@
#include <QtCore/qdebug.h>
#include <private/qobject_p.h>
#include <QSslError>
+#include <QOpenGLContext>
#define IMAGEREQUEST_MAX_REQUEST_COUNT 8
#define IMAGEREQUEST_MAX_REDIRECT_RECURSION 16
@@ -724,7 +725,7 @@ QDeclarativePixmapStore::QDeclarativePixmapStore()
void QDeclarativePixmapStore::cleanTextureForContext(QDeclarativePixmapData *data)
{
if (data->context) {
- Q_ASSERT(QGLContext::currentContext());
+ Q_ASSERT(QOpenGLContext::currentContext());
delete data->texture;
data->context = 0;
data->texture = 0;
diff --git a/src/imports/etcprovider/qetcprovider.cpp b/src/imports/etcprovider/qetcprovider.cpp
index 3e76c017a4..053258a794 100644
--- a/src/imports/etcprovider/qetcprovider.cpp
+++ b/src/imports/etcprovider/qetcprovider.cpp
@@ -44,7 +44,8 @@
#include <QtDebug>
#include <QFile>
-#include <qglfunctions.h>
+#include <qopenglfunctions.h>
+#include <qopenglcontext.h>
QT_BEGIN_NAMESPACE
@@ -118,7 +119,7 @@ void EtcTexture::bind()
"paddedWidth: " << m_paddedSize.width() << "paddedHeight: " << m_paddedSize.height();
#endif
- const QGLContext *ctx = QGLContext::currentContext();
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
Q_ASSERT(ctx != 0);
ctx->functions()->glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_ETC1_RGB8_OES,
m_size.width(), m_size.height(), 0,
diff --git a/src/imports/etcprovider/qetcprovider.h b/src/imports/etcprovider/qetcprovider.h
index a34b458b70..46ec421162 100644
--- a/src/imports/etcprovider/qetcprovider.h
+++ b/src/imports/etcprovider/qetcprovider.h
@@ -42,7 +42,7 @@
#ifndef QETCPROVIDER_H
#define QETCPROVIDER_H
-#include <qgl.h>
+#include <qopengl.h>
#include <QDeclarativeImageProvider>
#include <QSGTexture>
#include <QDeclarativeEngine>
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp
index 3164d9ec06..7f16eddc7e 100644
--- a/src/qmltest/quicktest.cpp
+++ b/src/qmltest/quicktest.cpp
@@ -54,7 +54,7 @@
#endif
#include <QtDeclarative/qjsvalue.h>
#include <QtDeclarative/qjsengine.h>
-#include <QtOpenGL/qgl.h>
+#include <QtGui/qopengl.h>
#include <QtCore/qurl.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qdir.h>
diff --git a/src/qmltest/quicktest.h b/src/qmltest/quicktest.h
index 1f8fe210e7..a83d176cfa 100644
--- a/src/qmltest/quicktest.h
+++ b/src/qmltest/quicktest.h
@@ -45,7 +45,7 @@
#include <QtQuickTest/quicktestglobal.h>
#include <QtWidgets/qwidget.h>
#ifdef QT_OPENGL_LIB
-#include <QtOpenGL/qgl.h>
+#include <QtGui/qopengl.h>
#endif
QT_BEGIN_NAMESPACE
@@ -65,7 +65,7 @@ Q_QUICK_TEST_EXPORT int quick_test_main(int argc, char **argv, const char *name,
#define QUICK_TEST_OPENGL_MAIN(name) \
static QWidget *name##_create_viewport() \
{ \
- return new QGLWidget(); \
+ return new QOpenGLWidget(); \
} \
int main(int argc, char **argv) \
{ \
@@ -83,7 +83,7 @@ Q_QUICK_TEST_EXPORT int quick_test_main(int argc, char **argv, const char *name,
#define QUICK_TEST_OPENGL_MAIN(name) \
static QWidget *name##_create_viewport() \
{ \
- return new QGLWidget(); \
+ return new QOpenGLWidget(); \
} \
int main(int argc, char **argv) \
{ \