summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qrawfont.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-04-27 14:21:54 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-04-28 11:01:04 +0200
commit07fa0ccfc458c217ba1c071784e980f65f404f84 (patch)
tree448f84635e988aeca08fe66b597688c183b898ac /src/gui/text/qrawfont.cpp
parent9e57cd5e6a1793994fc538f410cce0fc64de95c3 (diff)
Make QtQuick2 compile on QPA
Moved the logic to set pixel size into the font engines to avoid making the platform plugin interface too complex, and added a function in QPA to make an isolated font engine based on font data. Currently none of the QPA back-ends supports it, but it compiles and spits out a warning if you try to create a QRawFont from data there. This isn't used in QtQuick2 anyway. Reviewed-by: Jiang Jiang
Diffstat (limited to 'src/gui/text/qrawfont.cpp')
-rw-r--r--src/gui/text/qrawfont.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index 4a715c27cc..6ac2677c02 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -579,8 +579,19 @@ QRawFont QRawFont::fromFont(const QFont &font, QFontDatabase::WritingSystem writ
*/
void QRawFont::setPixelSize(int pixelSize)
{
+ if (d->fontEngine == 0)
+ return;
+
detach();
- d->platformSetPixelSize(pixelSize);
+ QFontEngine *oldFontEngine = d->fontEngine;
+
+ d->fontEngine = d->fontEngine->cloneWithSize(pixelSize);
+ if (d->fontEngine != 0)
+ d->fontEngine->ref.ref();
+
+ oldFontEngine->ref.deref();
+ if (oldFontEngine->cache_count == 0 && oldFontEngine->ref == 0)
+ delete oldFontEngine;
}
/*!