Rename QGuiGLContext -> QOpenGLContext, QGL* -> QOpenGL*, etc.
Change-Id: I08379029d756e28b20ae141ca30ed801626b513d
Reviewed-on: http://codereview.qt.nokia.com/3711
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
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
#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"
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
{
if (context->isReady())
return;
- QGLContext *glctx = const_cast<QGLContext *>(QGLContext::currentContext());
+ QOpenGLContext *glctx = const_cast<QOpenGLContext *>(QOpenGLContext::currentContext());
context->initialize(glctx);
Q_Q(QSGCanvas);
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()) {
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;
void QSGCanvasRenderLoop::createGLContext()
{
- gl = new QGuiGLContext();
+ gl = new QOpenGLContext();
gl->create();
}
#define QSGCANVAS_H
#include <QtCore/qmetatype.h>
-#include <QtOpenGL/qgl.h>
+#include <QtGui/qopengl.h>
#include <QtWidgets/qwidget.h>
QT_BEGIN_HEADER
class QSGItem;
class QSGEngine;
class QSGCanvasPrivate;
-class QGLFramebufferObject;
+class QOpenGLFramebufferObject;
class Q_DECLARATIVE_EXPORT QSGCanvas : public QWindow
{
QImage grabFrameBuffer();
- void setRenderTarget(QGLFramebufferObject *fbo);
- QGLFramebufferObject *renderTarget() const;
+ void setRenderTarget(QOpenGLFramebufferObject *fbo);
+ QOpenGLFramebufferObject *renderTarget() const;
signals:
void frameSwapped();
#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
QAnimationDriver *animationDriver;
- QGLFramebufferObject *renderTarget;
+ QOpenGLFramebufferObject *renderTarget;
QHash<int, QSGItem *> itemForTouchPointId;
};
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(); }
QSGCanvasPrivate *d;
QSGCanvas *renderer;
- QGuiGLContext *gl;
+ QOpenGLContext *gl;
};
class QSGCanvasRenderThread : public QThread, public QSGCanvasRenderLoop
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().
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.
#include <qsgshadereffectsource_p.h>
#include <QtCore/qsignalmapper.h>
-#include <QtOpenGL/qglframebufferobject.h>
+#include <QtGui/qopenglframebufferobject.h>
QT_BEGIN_NAMESPACE
#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
}
}
- 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) {
#include <private/qsgadaptationlayer_p.h>
#include <private/qsgrenderer_p.h>
-#include "qglframebufferobject.h"
+#include "qopenglframebufferobject.h"
#include "qmath.h"
#include <private/qsgtexture_p.h>
// 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);
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);
}
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());
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);
}
class QSGNode;
class UpdatePaintNodeData;
-class QGLFramebufferObject;
+class QOpenGLFramebufferObject;
class QSGShaderEffectSourceTextureProvider;
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;
#include <QDebug>
#include <QPainter>
#include <QSet>
-#include <QtOpenGL>
+#include <QtGui>
QT_BEGIN_NAMESPACE
#include <qsgnode.h>
#include <qsgtext_p.h>
+#include <qglyphrun.h>
QT_BEGIN_NAMESPACE
#include "qsgparticleemitter_p.h"
#include "qsgsprite_p.h"
#include "qsgspriteengine_p.h"
-#include <QGLFunctions>
+#include <QOpenGLFunctions>
#include <qsgengine.h>
QT_BEGIN_NAMESPACE
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");
int m_opacitytable_id;
QByteArray m_vertex_code;
QByteArray m_fragment_code;
- QGLFunctions* glFuncs;
+ QOpenGLFunctions* glFuncs;
};
class DeformableMaterialData : public ImageMaterialData {};
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");
}
int m_timestamp_id;
QByteArray m_vertex_code;
QByteArray m_fragment_code;
- QGLFunctions* glFuncs;
+ QOpenGLFunctions* glFuncs;
};
class SpriteMaterialData : public ImageMaterialData {};
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");
int m_opacitytable_id;
QByteArray m_vertex_code;
QByteArray m_fragment_code;
- QGLFunctions* glFuncs;
+ QOpenGLFunctions* glFuncs;
};
class ColoredMaterialData : public ImageMaterialData {};
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");
}
int m_entry_id;
QByteArray m_vertex_code;
QByteArray m_fragment_code;
- QGLFunctions* glFuncs;
+ QOpenGLFunctions* glFuncs;
};
class SimpleMaterialData : public ImageMaterialData {};
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");
}
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)
#ifndef QSGGEOMETRY_H
#define QSGGEOMETRY_H
-#include <QtOpenGL/qgl.h>
+#include <QtGui/qopengl.h>
+#include <QRectF>
QT_BEGIN_HEADER
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
/*!
- \fn QGLShaderProgram *QSGMaterialShader::program() const
+ \fn QOpenGLShaderProgram *QSGMaterialShader::program() const
Returns the shader program used by this QSGMaterialShader.
*/
/*!
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()
{
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
/*!
- 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();
}
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
#ifndef MATERIAL_H
#define MATERIAL_H
-#include <qglshaderprogram.h>
+#include <qopenglshaderprogram.h>
QT_BEGIN_HEADER
QRect viewportRect() const;
QRect deviceRect() const;
- const QGLContext *context() const;
+ QOpenGLContext *context() const;
private:
friend class QSGRenderer;
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:
virtual const char *fragmentShader() const = 0;
private:
- QGLShaderProgram m_program;
+ QOpenGLShaderProgram m_program;
void *m_reserved;
};
#include "private/qsgadaptationlayer_p.h"
-#include <QGLShaderProgram>
-#include <qglframebufferobject.h>
+#include <QOpenGLShaderProgram>
+#include <qopenglframebufferobject.h>
#include <QtWidgets/qapplication.h>
#include <qdatetime.h>
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
-QSGBindableFbo::QSGBindableFbo(QGLFramebufferObject *fbo) : m_fbo(fbo)
+QSGBindableFbo::QSGBindableFbo(QOpenGLFramebufferObject *fbo) : m_fbo(fbo)
{
}
class B : public QSGBindable
{
public:
- void bind() const { QGLFramebufferObject::bindDefault(); }
+ void bind() const { QOpenGLFramebufferObject::bindDefault(); }
} b;
renderScene(b);
}
} 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!
"}");
~QSGRendererVBOGeometryData()
{
- QGLFunctions *func = QGLContext::currentContext()->functions();
+ QOpenGLFunctions *func = QOpenGLContext::currentContext()->functions();
if (vertexBuffer)
func->glDeleteBuffers(1, &vertexBuffer);
if (indexBuffer)
#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"
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:
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();
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;
class QSGBindableFbo : public QSGBindable
{
public:
- QSGBindableFbo(QGLFramebufferObject *fbo);
+ QSGBindableFbo(QOpenGLFramebufferObject *fbo);
virtual void bind() const;
private:
- QGLFramebufferObject *m_fbo;
+ QOpenGLFramebufferObject *m_fbo;
};
#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>
#include <qsgengine.h>
#include <QApplication>
-#include <QGLContext>
+#include <QOpenGLContext>
#include <private/qobject_p.h>
#include <qmutex.h>
QSGRootNode *rootNode;
QSGRenderer *renderer;
- QGLContext *gl;
+ QOpenGLContext *gl;
QSGEngine engine;
\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
}
-QGLContext *QSGContext::glContext() const
+QOpenGLContext *QSGContext::glContext() const
{
Q_D(const QSGContext);
return d->gl;
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);
}
-void QSGContext::renderNextFrame(QGLFramebufferObject *fbo)
+void QSGContext::renderNextFrame(QOpenGLFramebufferObject *fbo)
{
Q_D(QSGContext);
#ifndef QSGCONTEXT_H
#define QSGCONTEXT_H
+#include <QImage>
#include <QObject>
#include <qabstractanimation.h>
class QSGMaterialShader;
class QSGEngine;
-class QGLContext;
-class QGLFramebufferObject;
+class QOpenGLContext;
+class QOpenGLFramebufferObject;
class Q_DECLARATIVE_EXPORT QSGContext : public QObject
{
explicit QSGContext(QObject *parent = 0);
~QSGContext();
- virtual void initialize(QGLContext *context);
+ virtual void initialize(QOpenGLContext *context);
QSGRenderer *renderer() const;
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();
#include "qsgdefaultglyphnode_p.h"
#include "qsgdefaultglyphnode_p_p.h"
-#include <qglshaderprogram.h>
+#include <qopenglshaderprogram.h>
#include <private/qfont_p.h>
QT_BEGIN_NAMESPACE
#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>
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,
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
#ifndef TEXTMASKMATERIAL_H
#define TEXTMASKMATERIAL_H
+#include <qcolor.h>
#include <qsgmaterial.h>
#include <qsgtexture.h>
#include <qsggeometry.h>
QT_BEGIN_NAMESPACE
class QFontEngineGlyphCache;
-class QGLTextureGlyphCache;
+class QOpenGLTextureGlyphCache;
class QFontEngine;
class Geometry;
class QSGTextMaskMaterial: public QSGMaterial
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);
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qmath.h>
-#include <QtOpenGL/qglfunctions.h>
+#include <QtGui/qopenglfunctions.h>
QT_BEGIN_NAMESPACE
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());
#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
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)
{
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);
}
-QHash<QString, QGLContextGroupResource<QSGDistanceFieldGlyphCache::DistanceFieldTextureData> > QSGDistanceFieldGlyphCache::m_textures_data;
+QHash<QString, QOpenGLMultiGroupSharedResource> QSGDistanceFieldGlyphCache::m_textures_data;
QSGDistanceFieldGlyphCache::DistanceFieldTextureData *QSGDistanceFieldGlyphCache::textureData()
{
.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)
{
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) { }
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());
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);
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);
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)
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
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) {
bool QSGDistanceFieldGlyphCache::useWorkaroundBrokenFBOReadback() const
{
- return ctx->d_ptr->workaround_brokenFBOReadBack;
+ return ctx->d_func()->workaround_brokenFBOReadBack;
}
int QSGDistanceFieldGlyphCache::glyphCount() const
#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>
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);
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]; }
private:
QHash<QFontEngine *, QSGDistanceFieldGlyphCache *> m_caches;
- const QGLContext *ctx;
+ QOpenGLContext *ctx;
QSGGlyphNode::AntialiasingMode m_defaultAntialiasingMode;
ThresholdFunc m_threshold_func;
mutable int m_maxTextureSize;
- QGLShaderProgram *m_blitProgram;
+ QOpenGLShaderProgram *m_blitProgram;
GLfloat m_vertexCoordinateArray[8];
GLfloat m_textureCoordinateArray[8];
};
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;
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;
};
#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
#include <math.h>
-#include <private/qgl_p.h>
+#include <private/qopengl_p.h>
#include <private/qrbtree_p.h>
QT_BEGIN_NAMESPACE
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 \
#include "qsgflatcolormaterial.h"
-#include <qglshaderprogram.h>
+#include <qopenglshaderprogram.h>
QT_BEGIN_NAMESPACE
#define FLATCOLORMATERIAL_H
#include <qsgmaterial.h>
+#include <qcolor.h>
QT_BEGIN_HEADER
#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
#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;
}
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();
}
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())
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)
QT_MODULE(Declarative)
-class QGLFramebufferObject;
+class QOpenGLFramebufferObject;
class Q_DECLARATIVE_EXPORT QSGPainterTexture : public QSGPlainTexture
{
QSGPaintedItem *m_item;
- QGLFramebufferObject *m_fbo;
- QGLFramebufferObject *m_multisampledFbo;
+ QOpenGLFramebufferObject *m_fbo;
+ QOpenGLFramebufferObject *m_multisampledFbo;
QImage m_image;
QSGOpaqueTextureMaterial m_material;
#define GL_GLEXT_PROTOTYPES
#include <private/qsgtexture_p.h>
-#include <qglfunctions.h>
+#include <qopenglfunctions.h>
#include <private/qsgcontext_p.h>
#include <qthread.h>
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)
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;
}
#endif
if (m_has_mipmaps) {
- const QGLContext *ctx = QGLContext::currentContext();
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
ctx->functions()->glGenerateMipmap(GL_TEXTURE_2D);
m_mipmaps_generated = true;
}
#include <private/qobject_p.h>
-#include <QtOpenGL/qgl.h>
+#include <QtGui/qopengl.h>
#include "qsgtexture.h"
#include <private/qsgcontext_p.h>
#include "qsgtexturematerial_p.h"
-#include <QtOpenGL/qglshaderprogram.h>
-#include <QtOpenGL/qglfunctions.h>
+#include <QtGui/qopenglshaderprogram.h>
+#include <QtGui/qopenglfunctions.h>
QT_BEGIN_NAMESPACE
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) {
#include "qsgvertexcolormaterial_p.h"
-#include <qglshaderprogram.h>
+#include <qopenglshaderprogram.h>
QT_BEGIN_NAMESPACE
#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
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;
#include <QtDebug>
#include <QFile>
-#include <qglfunctions.h>
+#include <qopenglfunctions.h>
+#include <qopenglcontext.h>
QT_BEGIN_NAMESPACE
"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,
#ifndef QETCPROVIDER_H
#define QETCPROVIDER_H
-#include <qgl.h>
+#include <qopengl.h>
#include <QDeclarativeImageProvider>
#include <QSGTexture>
#include <QDeclarativeEngine>
#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>
#include <QtQuickTest/quicktestglobal.h>
#include <QtWidgets/qwidget.h>
#ifdef QT_OPENGL_LIB
-#include <QtOpenGL/qgl.h>
+#include <QtGui/qopengl.h>
#endif
QT_BEGIN_NAMESPACE
#define QUICK_TEST_OPENGL_MAIN(name) \
static QWidget *name##_create_viewport() \
{ \
- return new QGLWidget(); \
+ return new QOpenGLWidget(); \
} \
int main(int argc, char **argv) \
{ \
#define QUICK_TEST_OPENGL_MAIN(name) \
static QWidget *name##_create_viewport() \
{ \
- return new QGLWidget(); \
+ return new QOpenGLWidget(); \
} \
int main(int argc, char **argv) \
{ \