summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-08 09:24:48 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-08 09:24:48 (GMT)
commit60245f480c38256d53a47e251e963dc17ea1524b (patch)
tree7c456bfb3f5085d4fe52d384b02fb8e64e981b42 /src
parent392ecc76cdbcef37ee492400a1b783106a37ad36 (diff)
parent69ae7469eebda30dbf430ca67d193a62969f516c (diff)
downloadQt-60245f480c38256d53a47e251e963dc17ea1524b.zip
Qt-60245f480c38256d53a47e251e963dc17ea1524b.tar.gz
Qt-60245f480c38256d53a47e251e963dc17ea1524b.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QGradientCache: Optimize choosing of which gradient to evict from cache
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index dbf7b26..23be51b 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -4960,8 +4960,8 @@ protected:
int size, int opacity) const;
uint *addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity) {
if (cache.size() == maxCacheSize()) {
- int elem_to_remove = qrand() % maxCacheSize();
- cache.remove(cache.keys()[elem_to_remove]); // may remove more than 1, but OK
+ // may remove more than 1, but OK
+ cache.erase(cache.begin() + (qrand() % maxCacheSize()));
}
CacheInfo cache_entry(gradient.stops(), opacity, gradient.interpolationMode());
generateGradientColorTable(gradient, cache_entry.buffer, paletteSize(), opacity);