Reserve 80 items instead of creating them.

svn path=/trunk/KDE/kdebase/workspace/; revision=741041
This commit is contained in:
Rivo Laks 2007-11-24 16:51:48 +00:00
parent e0c50df7e3
commit 85e31c0010
2 changed files with 6 additions and 2 deletions

View file

@ -113,7 +113,9 @@ void ShadowEffect::drawShadow( EffectWindow* window, int mask, QRegion region, W
if(( mask & PAINT_WINDOW_TRANSFORMED ) && ( data.xScale != 1 || data.yScale != 1 ))
glScalef( data.xScale, data.yScale, 1 );
QVector<float> verts(80), texcoords(80);
QVector<float> verts, texcoords;
verts.reserve(80);
texcoords.reserve(80);
// center
addQuadVertices(verts, 0 + fuzzy, 0 + fuzzy, w - fuzzy, h - fuzzy);
addQuadVertices(texcoords, 0.5, 0.5, 0.5, 0.5);

View file

@ -278,7 +278,9 @@ void renderRoundBox( const QRect& area, float roundness, GLTexture* texture )
glPushMatrix();
QVector<float> verts(80), texcoords(80);
QVector<float> verts, texcoords;
verts.reserve(80);
texcoords.reserve(80);
// center
addQuadVertices(verts, area.left() + roundness, area.top() + roundness, area.right() - roundness, area.bottom() - roundness);
addQuadVertices(texcoords, 0.5, 0.5, 0.5, 0.5);