summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpaintengine_opengl.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-05-07 06:15:37 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-05-07 06:15:37 (GMT)
commit4976130171033abdd8323a19229dcbfc5b008cfe (patch)
tree06fb286c8831e943941a9dabf081fe704fcfda88 /src/opengl/qpaintengine_opengl.cpp
parent65d04843759d14f15f559c78df94626568bc0cb8 (diff)
downloadQt-4976130171033abdd8323a19229dcbfc5b008cfe.zip
Qt-4976130171033abdd8323a19229dcbfc5b008cfe.tar.gz
Qt-4976130171033abdd8323a19229dcbfc5b008cfe.tar.bz2
Avoid many unnecessary allocations, so so that paint engines attached to pixmaps
do not consume excessive amounts of memory, and so can still be reasonably kept cached with the pixmap. Saves 8K for every pixmaps drawn to on raster paint engine. Saves about 2K for other graphicssystems. Task-number: QTBUG-10215 Reviewed-by: Gunnar
Diffstat (limited to 'src/opengl/qpaintengine_opengl.cpp')
-rw-r--r--src/opengl/qpaintengine_opengl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index 306fd8b..d2b0d4f 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -668,6 +668,7 @@ public:
, last_created_state(0)
, shader_ctx(0)
, grad_palette(0)
+ , tess_points(0)
, drawable_texture(0)
, ref_cleaner(this)
{}
@@ -1950,6 +1951,8 @@ void QOpenGLPaintEnginePrivate::pathToVertexArrays(const QPainterPath &path)
void QOpenGLPaintEnginePrivate::drawVertexArrays()
{
+ if (tess_points_stops.count() == 0)
+ return;
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_DOUBLE, 0, tess_points.data());
int previous_stop = 0;