summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-10-19 14:20:26 +0200
committerGunnar Sletta <gunnar@trolltech.com>2009-10-19 14:20:26 +0200
commit4d94420184fa109286a9e4233010d5d7539a35a4 (patch)
treeac6b272f66ffb4f94b6b0994e04d92aac10246e5 /src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
parent8182dc12b88727c647f9bac4d9a19914e3cd8307 (diff)
Integrated new triangulating stroker into Qt
Diffstat (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 5704a04ac0..209cd36b79 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -62,6 +62,7 @@
#include <private/qglpixmapfilter_p.h>
#include <private/qfontengine_p.h>
#include <private/qdatabuffer_p.h>
+#include <private/qtriangulatingstroker_p.h>
enum EngineMode {
ImageDrawingMode,
@@ -160,6 +161,12 @@ class QGL2PaintEngineExPrivate : public QPaintEngineExPrivate
{
Q_DECLARE_PUBLIC(QGL2PaintEngineEx)
public:
+ enum StencilFillMode {
+ OddEvenFillMode,
+ WindingFillMode,
+ TriStripStrokeFillMode
+ };
+
QGL2PaintEngineExPrivate(QGL2PaintEngineEx *q_ptr) :
q(q_ptr),
width(0), height(0),
@@ -185,15 +192,24 @@ public:
// fill, drawOutline, drawTexture & drawCachedGlyphs are the rendering entry points:
void fill(const QVectorPath &path);
- void drawOutline(const QVectorPath& path);
void drawTexture(const QGLRect& dest, const QGLRect& src, const QSize &textureSize, bool opaque, bool pattern = false);
void drawCachedGlyphs(const QPointF &p, QFontEngineGlyphCache::Type glyphType, const QTextItemInt &ti);
- void drawVertexArrays(QGL2PEXVertexArray& vertexArray, GLenum primitive);
+ void drawVertexArrays(const float *data, const QVector<int> *stops, GLenum primitive);
+ void drawVertexArrays(QGL2PEXVertexArray &vertexArray, GLenum primitive) {
+ drawVertexArrays((const float *) vertexArray.data(), &vertexArray.stops(), primitive);
+ }
+
// ^ draws whatever is in the vertex array
void composite(const QGLRect& boundingRect);
// ^ Composites the bounding rect onto dest buffer
- void fillStencilWithVertexArray(QGL2PEXVertexArray& vertexArray, bool useWindingFill);
+
+ void fillStencilWithVertexArray(const float *data, int count, const QVector<int> *stops, const QGLRect &bounds, StencilFillMode mode);
+ void fillStencilWithVertexArray(QGL2PEXVertexArray& vertexArray, bool useWindingFill) {
+ fillStencilWithVertexArray((const float *) vertexArray.data(), 0, &vertexArray.stops(),
+ vertexArray.boundingRect(),
+ useWindingFill ? WindingFillMode : OddEvenFillMode);
+ }
// ^ Calls drawVertexArrays to render into stencil buffer
bool prepareForDraw(bool srcPixelsAreOpaque);
@@ -266,6 +282,10 @@ public:
float textureInvertedY;
+ QTriangulatingStroker stroker;
+ QDashedStrokeProcessor dasher;
+ QTransform temporaryTransform;
+
QScopedPointer<QPixmapFilter> convolutionFilter;
QScopedPointer<QPixmapFilter> colorizeFilter;
QScopedPointer<QPixmapFilter> blurFilter;