aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-08-25 13:40:12 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-08-29 10:25:51 +0200
commit957c8fb9946643a779e0a84eeeca2f150f221cba (patch)
treef3cd7b62c4943f1c62c6da0ff802b296ac66c88d /src/declarative/items
parentf37b38e4cd4aa9e0443640a1fd73c239cab0d45e (diff)
Get declarative running on new gui/opengl stack.
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>
Diffstat (limited to 'src/declarative/items')
-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
12 files changed, 45 insertions, 43 deletions
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