From 85e31c0010b2fdd4935c5235c1201f98a39b1e07 Mon Sep 17 00:00:00 2001 From: Rivo Laks Date: Sat, 24 Nov 2007 16:51:48 +0000 Subject: [PATCH] Reserve 80 items instead of creating them. svn path=/trunk/KDE/kdebase/workspace/; revision=741041 --- effects/shadow.cpp | 4 +++- lib/kwinglutils.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/effects/shadow.cpp b/effects/shadow.cpp index 55b82d58a0..01d348a1c1 100644 --- a/effects/shadow.cpp +++ b/effects/shadow.cpp @@ -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 verts(80), texcoords(80); + QVector 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); diff --git a/lib/kwinglutils.cpp b/lib/kwinglutils.cpp index 7c9aff5803..47140105e7 100644 --- a/lib/kwinglutils.cpp +++ b/lib/kwinglutils.cpp @@ -278,7 +278,9 @@ void renderRoundBox( const QRect& area, float roundness, GLTexture* texture ) glPushMatrix(); - QVector verts(80), texcoords(80); + QVector 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);