summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorWater-Team <water@pad.test.qt.nokia.com>2011-09-16 23:00:14 (GMT)
committerWater-Team <water@pad.test.qt.nokia.com>2011-09-16 23:00:14 (GMT)
commit84ace02a016ded4752b6711166dd16dd8bfb4330 (patch)
tree5139697f5441ee32183b801798e846f364e53f28 /src/gui
parent2fa6d410c6733863b19393c13efbdcb7efd59fc0 (diff)
parente1de7eda203cef794bb48c01155a7eaea24f902d (diff)
downloadQt-84ace02a016ded4752b6711166dd16dd8bfb4330.zip
Qt-84ace02a016ded4752b6711166dd16dd8bfb4330.tar.gz
Qt-84ace02a016ded4752b6711166dd16dd8bfb4330.tar.bz2
Merge branch '4.8-upstream' into master-water
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qtextengine.cpp12
-rw-r--r--src/gui/text/qtextengine_p.h2
-rw-r--r--src/gui/text/qtextlayout.cpp4
3 files changed, 13 insertions, 5 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 4886006..2fc1dbd 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1386,6 +1386,7 @@ QTextEngine::~QTextEngine()
if (!stackEngine)
delete layoutData;
delete specialData;
+ resetFontEngineCache();
}
const HB_CharAttributes *QTextEngine::attributes() const
@@ -1446,6 +1447,13 @@ static inline void releaseCachedFontEngine(QFontEngine *fontEngine)
}
}
+void QTextEngine::resetFontEngineCache()
+{
+ releaseCachedFontEngine(feCache.prevFontEngine);
+ releaseCachedFontEngine(feCache.prevScaledFontEngine);
+ feCache.reset();
+}
+
void QTextEngine::invalidate()
{
freeMemory();
@@ -1454,9 +1462,7 @@ void QTextEngine::invalidate()
if (specialData)
specialData->resolvedFormatIndices.clear();
- releaseCachedFontEngine(feCache.prevFontEngine);
- releaseCachedFontEngine(feCache.prevScaledFontEngine);
- feCache.reset();
+ resetFontEngineCache();
}
void QTextEngine::clearLineData()
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index 0a86886..067e81d 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -630,6 +630,8 @@ public:
int positionAfterVisualMovement(int oldPos, QTextCursor::MoveOperation op);
void insertionPointsForLine(int lineNum, QVector<int> &insertionPoints);
+ void resetFontEngineCache();
+
private:
void setBoundary(int strPos) const;
void addRequiredBoundaries() const;
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 4595ef5..83c3676 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -375,7 +375,7 @@ QTextLayout::~QTextLayout()
void QTextLayout::setFont(const QFont &font)
{
d->fnt = font;
- d->feCache.reset();
+ d->resetFontEngineCache();
}
/*!
@@ -515,7 +515,7 @@ void QTextLayout::setAdditionalFormats(const QList<FormatRange> &formatList)
}
if (d->block.docHandle())
d->block.docHandle()->documentChange(d->block.position(), d->block.length());
- d->feCache.reset();
+ d->resetFontEngineCache();
}
/*!