summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-11-25 09:14:04 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-11-25 09:14:04 (GMT)
commit4f4f1e612488f400b2b139eaf7fea940fb6d7e7c (patch)
treef4bf33ae8436b3cda1161111aea5f7ef63093506 /src
parent33628442d1c0e3b9b15ee5c54a586a80e21727c6 (diff)
downloadQt-4f4f1e612488f400b2b139eaf7fea940fb6d7e7c.zip
Qt-4f4f1e612488f400b2b139eaf7fea940fb6d7e7c.tar.gz
Qt-4f4f1e612488f400b2b139eaf7fea940fb6d7e7c.tar.bz2
Don't spend time on adding center point for convex paths, saves a few cycles.
Reviewed-by: Samuel
Diffstat (limited to 'src')
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
index 67a4128..ee1a797 100644
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
@@ -101,7 +101,7 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc
boundingRectDirty = false;
}
- if (!outline)
+ if (!outline && !path.isConvex())
addCentroid(path, 0);
int lastMoveTo = vertexArray.size();
@@ -127,7 +127,7 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc
// qDebug("element[%d] is a MoveToElement", i);
vertexArrayStops.add(vertexArray.size());
if (!outline) {
- addCentroid(path, i);
+ if (!path.isConvex()) addCentroid(path, i);
lastMoveTo = vertexArray.size();
}
lineToArray(points[i].x(), points[i].y()); // Add the moveTo as a new vertex