summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-19 13:06:01 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-19 13:06:01 (GMT)
commitb28e104cd12f73f5b18244995176f678a9188364 (patch)
treed78c9ba6c7e97271950ecb0fe7f7086ed443be29 /src/opengl
parent665a506fbee9f4c39dfe3b577338815270f090c5 (diff)
downloadQt-b28e104cd12f73f5b18244995176f678a9188364.zip
Qt-b28e104cd12f73f5b18244995176f678a9188364.tar.gz
Qt-b28e104cd12f73f5b18244995176f678a9188364.tar.bz2
Inline QGL2PEXVertexArray::addRect()
Optimization for drawStaticText()
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp15
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h16
2 files changed, 15 insertions, 16 deletions
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
index 3f08dbe..e454c12 100644
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
@@ -61,21 +61,6 @@ QGLRect QGL2PEXVertexArray::boundingRect() const
return QGLRect(minX, minY, maxX, maxY);
}
-void QGL2PEXVertexArray::addRect(const QRectF &rect)
-{
- qreal top = rect.top();
- qreal left = rect.left();
- qreal bottom = rect.bottom();
- qreal right = rect.right();
-
- vertexArray << QGLPoint(left, top)
- << QGLPoint(right, top)
- << QGLPoint(right, bottom)
- << QGLPoint(right, bottom)
- << QGLPoint(left, bottom)
- << QGLPoint(left, top);
-}
-
void QGL2PEXVertexArray::addClosingLine(int index)
{
if (QPointF(vertexArray.at(index)) != QPointF(vertexArray.last()))
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
index e0497b1..ae73040 100644
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
@@ -102,8 +102,22 @@ public:
QGL2PEXVertexArray() :
maxX(-2e10), maxY(-2e10), minX(2e10), minY(2e10),
boundingRectDirty(true) {}
+
+ inline void addRect(const QRectF &rect)
+ {
+ qreal top = rect.top();
+ qreal left = rect.left();
+ qreal bottom = rect.bottom();
+ qreal right = rect.right();
+
+ vertexArray << QGLPoint(left, top)
+ << QGLPoint(right, top)
+ << QGLPoint(right, bottom)
+ << QGLPoint(right, bottom)
+ << QGLPoint(left, bottom)
+ << QGLPoint(left, top);
+ }
- void addRect(const QRectF &rect);
void addPath(const QVectorPath &path, GLfloat curveInverseScale, bool outline = true);
void clear();