summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-11-25 09:05:31 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-11-25 09:05:31 (GMT)
commit33628442d1c0e3b9b15ee5c54a586a80e21727c6 (patch)
tree6692f22d1d4a719e4fe940adffa526434891705b /src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
parent44c6308cb775e2ca53f8708ba87893b7e8bc2c2d (diff)
downloadQt-33628442d1c0e3b9b15ee5c54a586a80e21727c6.zip
Qt-33628442d1c0e3b9b15ee5c54a586a80e21727c6.tar.gz
Qt-33628442d1c0e3b9b15ee5c54a586a80e21727c6.tar.bz2
Replaced QVector in GL2 vertex array with QDataBuffer to reduce mallocs
Reviewed-by: Tom Cooksey
Diffstat (limited to 'src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp')
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
index e70b75e..67a4128 100644
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
void QGL2PEXVertexArray::clear()
{
vertexArray.reset();
- vertexArrayStops.clear();
+ vertexArrayStops.reset();
boundingRectDirty = true;
}
@@ -125,7 +125,7 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc
if (!outline)
addClosingLine(lastMoveTo);
// qDebug("element[%d] is a MoveToElement", i);
- vertexArrayStops.append(vertexArray.size());
+ vertexArrayStops.add(vertexArray.size());
if (!outline) {
addCentroid(path, i);
lastMoveTo = vertexArray.size();
@@ -143,7 +143,7 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc
points[i+2]);
QRectF bounds = b.bounds();
// threshold based on same algorithm as in qtriangulatingstroker.cpp
- int threshold = qMin<float>(64, qMax(bounds.width(), bounds.height()) * 3.14f / (curveInverseScale * 8));
+ int threshold = qMin<float>(64, qMax(bounds.width(), bounds.height()) * 3.14f / (curveInverseScale * 6));
if (threshold < 3) threshold = 3;
qreal one_over_threshold_minus_1 = 1.f / (threshold - 1);
for (int t=0; t<threshold; ++t) {
@@ -160,7 +160,7 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc
if (!outline)
addClosingLine(lastMoveTo);
- vertexArrayStops.append(vertexArray.size());
+ vertexArrayStops.add(vertexArray.size());
}
void QGL2PEXVertexArray::lineToArray(const GLfloat x, const GLfloat y)