diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-10-07 12:59:34 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-10-07 16:15:45 (GMT) |
commit | 14a8f1fb7414885cc3868b1d27699b5a0d59e7ee (patch) | |
tree | cd5527e8aec4c38a561d6bc81fac098491a334e7 /src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h | |
parent | 57209cf902f9d0c9bea5b599b54fa4bdc015d2b5 (diff) | |
download | Qt-14a8f1fb7414885cc3868b1d27699b5a0d59e7ee.zip Qt-14a8f1fb7414885cc3868b1d27699b5a0d59e7ee.tar.gz Qt-14a8f1fb7414885cc3868b1d27699b5a0d59e7ee.tar.bz2 |
Optimized rasterizing of paths using stencil method in GL 2 engine.
Making the triangle fan of each sub path start at the sub path's
centroid will on average improve performance for complex paths, because
less pixels that are outside the path need to be touched. The centroid
is a more balanced choice than just picking the first element of the
sub path as triangle fan origin.
A performance improvement of 20 % was measured for star formed paths.
Reviewed-by: Trond
Diffstat (limited to 'src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h')
-rw-r--r-- | src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h index 08ce234..719904f 100644 --- a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h +++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h @@ -104,7 +104,7 @@ public: boundingRectDirty(true) {} void addRect(const QRectF &rect); - void addPath(const QVectorPath &path, GLfloat curveInverseScale); + void addPath(const QVectorPath &path, GLfloat curveInverseScale, bool outline = true); void clear(); QGLPoint* data() {return vertexArray.data();} @@ -124,6 +124,9 @@ private: bool boundingRectDirty; inline void curveToArray(const QGLPoint &cp1, const QGLPoint &cp2, const QGLPoint &ep, GLfloat inverseScale); + + void addClosingLine(int index); + void addCentroid(const QVectorPath &path, int subPathIndex); }; QT_END_NAMESPACE |