summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-06 22:25:01 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-06 22:25:01 (GMT)
commit3f109fd85cbdc49dc3ef1c14066073079f4e34bf (patch)
tree0835717bbe2d0c3b79bed2146ea72bf494111913
parentf8b043f1d73906be593232cf02aa06e576ae4e27 (diff)
downloadQt-3f109fd85cbdc49dc3ef1c14066073079f4e34bf.zip
Qt-3f109fd85cbdc49dc3ef1c14066073079f4e34bf.tar.gz
Qt-3f109fd85cbdc49dc3ef1c14066073079f4e34bf.tar.bz2
Make QGraphicsShaderEffect private API for 4.6
The custom shader code in the OpenGL2 paint engine needs time to mature before we make this official public API. Reviewed-by: trustme
-rw-r--r--examples/effects/customshader/blureffect.cpp4
-rw-r--r--examples/effects/customshader/blureffect.h4
-rw-r--r--examples/effects/customshader/customshadereffect.h2
-rw-r--r--src/gui/effects/qgraphicseffect.cpp1
-rw-r--r--src/opengl/opengl.pro2
-rw-r--r--src/opengl/qgraphicsshadereffect.cpp18
-rw-r--r--src/opengl/qgraphicsshadereffect_p.h (renamed from src/opengl/qgraphicsshadereffect.h)17
7 files changed, 29 insertions, 19 deletions
diff --git a/examples/effects/customshader/blureffect.cpp b/examples/effects/customshader/blureffect.cpp
index 6fe8e86..f9e046e 100644
--- a/examples/effects/customshader/blureffect.cpp
+++ b/examples/effects/customshader/blureffect.cpp
@@ -56,10 +56,10 @@ void BlurEffect::adjustForItem()
setBlurRadius(radius);
}
-QRectF BlurEffect::boundingRectFor(const QRectF &rect) const
+QRectF BlurEffect::boundingRect() const
{
const_cast<BlurEffect *>(this)->adjustForItem();
- return QGraphicsBlurEffect::boundingRectFor(rect);
+ return QGraphicsBlurEffect::boundingRect();
}
void BlurEffect::draw(QPainter *painter, QGraphicsEffectSource *source)
diff --git a/examples/effects/customshader/blureffect.h b/examples/effects/customshader/blureffect.h
index 0cafd80..7c12ccf 100644
--- a/examples/effects/customshader/blureffect.h
+++ b/examples/effects/customshader/blureffect.h
@@ -52,9 +52,9 @@ public:
void setBaseLine(qreal y) { m_baseLine = y; }
- QRectF boundingRectFor(const QRectF &) const;
+ QRectF boundingRect() const;
- void draw(QPainter *painter, QGraphicsEffectSource*);
+ void draw(QPainter *painter, QGraphicsEffectSource *source);
private:
void adjustForItem();
diff --git a/examples/effects/customshader/customshadereffect.h b/examples/effects/customshader/customshadereffect.h
index 9ba5f15..6892d96 100644
--- a/examples/effects/customshader/customshadereffect.h
+++ b/examples/effects/customshader/customshadereffect.h
@@ -43,7 +43,7 @@
#define CUSTOMSHADEREFFECT_H
#include <QGraphicsEffect>
-#include <QGraphicsShaderEffect>
+#include <QtOpenGL/private/qgraphicsshadereffect_p.h>
#include <QGraphicsItem>
class CustomShaderEffect: public QGraphicsShaderEffect
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index 6629a6d..dd64ced 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -67,7 +67,6 @@
\o QGraphicsOpacityEffect - renders the item with an opacity
\o QGraphicsPixelizeEffect - pixelizes the item with any pixel size
\o QGraphicsGrayscaleEffect - renders the item in shades of gray
- \o QGraphicsShaderEffect - renders the item with a pixel shader fragment
\endlist
\img graphicseffect-effects.png
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index 458aa7e..560d31f 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -38,7 +38,7 @@ SOURCES += qgl.cpp \
!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles1cl) {
HEADERS += qglshaderprogram.h \
qglpixmapfilter_p.h \
- qgraphicsshadereffect.h \
+ qgraphicsshadereffect_p.h \
qgraphicssystem_gl_p.h \
qwindowsurface_gl_p.h \
qpixmapdata_gl_p.h \
diff --git a/src/opengl/qgraphicsshadereffect.cpp b/src/opengl/qgraphicsshadereffect.cpp
index f1558d1..f733109 100644
--- a/src/opengl/qgraphicsshadereffect.cpp
+++ b/src/opengl/qgraphicsshadereffect.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qgraphicsshadereffect.h"
+#include "qgraphicsshadereffect_p.h"
#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
#include "qglshaderprogram.h"
#include "gl2paintengineex/qglcustomshaderstage_p.h"
@@ -51,7 +51,7 @@
QT_BEGIN_NAMESPACE
-/*!
+/*#
\class QGraphicsShaderEffect
\brief The QGraphicsShaderEffect class is the base class for creating
custom GLSL shader effects in a QGraphicsScene.
@@ -175,7 +175,7 @@ public:
#endif
};
-/*!
+/*#
Constructs a shader effect and attaches it to \a parent.
*/
QGraphicsShaderEffect::QGraphicsShaderEffect(QObject *parent)
@@ -183,7 +183,7 @@ QGraphicsShaderEffect::QGraphicsShaderEffect(QObject *parent)
{
}
-/*!
+/*#
Destroys this shader effect.
*/
QGraphicsShaderEffect::~QGraphicsShaderEffect()
@@ -194,7 +194,7 @@ QGraphicsShaderEffect::~QGraphicsShaderEffect()
#endif
}
-/*!
+/*#
Returns the source code for the pixel shader fragment for
this shader effect. The default is a shader that copies
its incoming pixmap directly to the output with no effect
@@ -208,7 +208,7 @@ QByteArray QGraphicsShaderEffect::pixelShaderFragment() const
return d->pixelShaderFragment;
}
-/*!
+/*#
Sets the source code for the pixel shader fragment for
this shader effect to \a code.
@@ -238,7 +238,7 @@ void QGraphicsShaderEffect::setPixelShaderFragment(const QByteArray& code)
}
}
-/*!
+/*#
\reimp
*/
void QGraphicsShaderEffect::draw(QPainter *painter, QGraphicsEffectSource *source)
@@ -277,7 +277,7 @@ void QGraphicsShaderEffect::draw(QPainter *painter, QGraphicsEffectSource *sourc
#endif
}
-/*!
+/*#
Sets the custom uniform variables on this shader effect to
be dirty. The setUniforms() function will be called the next
time the shader program corresponding to this effect is used.
@@ -296,7 +296,7 @@ void QGraphicsShaderEffect::setUniformsDirty()
#endif
}
-/*!
+/*#
Sets custom uniform variables on the current GL context when
\a program is about to be used by the paint engine.
diff --git a/src/opengl/qgraphicsshadereffect.h b/src/opengl/qgraphicsshadereffect_p.h
index a186074..a313846 100644
--- a/src/opengl/qgraphicsshadereffect.h
+++ b/src/opengl/qgraphicsshadereffect_p.h
@@ -39,8 +39,19 @@
**
****************************************************************************/
-#ifndef QGRAPHICSSHADEREFFECT_H
-#define QGRAPHICSSHADEREFFECT_H
+#ifndef QGRAPHICSSHADEREFFECT_P_H
+#define QGRAPHICSSHADEREFFECT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
#include <QtGui/qgraphicseffect.h>
@@ -80,4 +91,4 @@ QT_END_NAMESPACE
QT_END_HEADER
-#endif // QGRAPHICSSHADEREFFECT_H
+#endif // QGRAPHICSSHADEREFFECT_P_H