summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-12-26 19:38:46 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-12-26 19:38:46 (GMT)
commit1a1eeba0086d764474546da7fe443bf210d4d974 (patch)
tree8d42fbce05e87c2908fcec8572a61c6501be5f15 /src
parent63bd10ae61ed0b877344b217e57eb87f77256e98 (diff)
parent53abbf0cedbf2e3478e63c1b007d27a943df630d (diff)
downloadQt-1a1eeba0086d764474546da7fe443bf210d4d974.zip
Qt-1a1eeba0086d764474546da7fe443bf210d4d974.tar.gz
Qt-1a1eeba0086d764474546da7fe443bf210d4d974.tar.bz2
Merge branch '4.5' into 4.6-staging
Conflicts: tests/benchmarks/benchmarks.pro
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qppmhandler.cpp2
-rw-r--r--src/opengl/qpaintengine_opengl.cpp14
2 files changed, 12 insertions, 4 deletions
diff --git a/src/gui/image/qppmhandler.cpp b/src/gui/image/qppmhandler.cpp
index 8ec9efb..f2d51f7 100644
--- a/src/gui/image/qppmhandler.cpp
+++ b/src/gui/image/qppmhandler.cpp
@@ -264,7 +264,7 @@ static bool write_pbm_image(QIODevice *out, const QImage &sourceImage, const QBy
bool gray = format == "pgm";
if (format == "pbm") {
- image = image.convertToFormat(QImage::Format_MonoLSB);
+ image = image.convertToFormat(QImage::Format_Mono);
} else if (image.depth() == 1) {
image = image.convertToFormat(QImage::Format_Indexed8);
} else {
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index ed7fdff..8dae02a 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -4522,6 +4522,12 @@ typedef QHash<QFontEngine*, QGLGlyphHash*> QGLFontGlyphHash;
typedef QHash<quint64, QGLFontTexture*> QGLFontTexHash;
typedef QHash<const QGLContext*, QGLFontGlyphHash*> QGLContextHash;
+static inline void qt_delete_glyph_hash(QGLGlyphHash *hash)
+{
+ qDeleteAll(*hash);
+ delete hash;
+}
+
class QGLGlyphCache : public QObject
{
Q_OBJECT
@@ -4562,7 +4568,7 @@ void QGLGlyphCache::fontEngineDestroyed(QObject *o)
if (font_cache->find(fe) != font_cache->end()) {
ctx = keys.at(i);
QGLGlyphHash *cache = font_cache->take(fe);
- delete cache;
+ qt_delete_glyph_hash(cache);
break;
}
}
@@ -4599,7 +4605,7 @@ void QGLGlyphCache::cleanupContext(const QGLContext *ctx)
QList<QFontEngine *> keys = font_cache->keys();
for (int i=0; i < keys.size(); ++i) {
QFontEngine *fe = keys.at(i);
- delete font_cache->take(fe);
+ qt_delete_glyph_hash(font_cache->take(fe));
quint64 font_key = (reinterpret_cast<quint64>(ctx) << 32) | reinterpret_cast<quint64>(fe);
QGLFontTexture *font_tex = qt_font_textures.take(font_key);
if (font_tex) {
@@ -4640,7 +4646,9 @@ void QGLGlyphCache::cleanCache()
QList<const QGLContext *> keys = qt_context_cache.keys();
for (int i=0; i < keys.size(); ++i) {
QGLFontGlyphHash *font_cache = qt_context_cache.value(keys.at(i));
- qDeleteAll(*font_cache);
+ QGLFontGlyphHash::Iterator it = font_cache->begin();
+ for (; it != font_cache->end(); ++it)
+ qt_delete_glyph_hash(it.value());
font_cache->clear();
}
qDeleteAll(qt_context_cache);