summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-09-16 11:18:17 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-09-16 11:18:17 (GMT)
commit03d99f6d1deee349013e6aa233bbf69635a7a3df (patch)
tree63a151037025135f91e10461a1a56db59735fac8 /src/gui/text
parent2fafbf51d6cd61d073c9f77dffd71864e9686de6 (diff)
parent57240c1f931eb4c340de6e2bb17972235265f89c (diff)
downloadQt-03d99f6d1deee349013e6aa233bbf69635a7a3df.zip
Qt-03d99f6d1deee349013e6aa233bbf69635a7a3df.tar.gz
Qt-03d99f6d1deee349013e6aa233bbf69635a7a3df.tar.bz2
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-fire-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-fire-team: Use more widely supported Unicode character representation Release font engine refcount when done using it in QTextEngine Fix - QGraphicsTextItem in a tab of QTabWidget cannot get focus Updated Changelog Do not put cursor at non-stop character positions doc: Fix incorrect enum name in QRawFont::alphaMapForGlyph docs
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qrawfont.cpp3
-rw-r--r--src/gui/text/qtextengine.cpp12
-rw-r--r--src/gui/text/qtextengine_p.h1
-rw-r--r--src/gui/text/qtextlayout.cpp7
4 files changed, 17 insertions, 6 deletions
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index 61bc63e..7c7d4eb 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -238,7 +238,8 @@ void QRawFont::loadFromData(const QByteArray &fontData,
If \a antialiasingType is set to QRawFont::SubPixelAntialiasing, then the resulting image will be
in QImage::Format_RGB32 and the RGB values of each pixel will represent the subpixel opacities of
the pixel in the rasterization of the glyph. Otherwise, the image will be in the format of
- QImage::Format_A8 and each pixel will contain the opacity of the pixel in the rasterization.
+ QImage::Format_Indexed8 and each pixel will contain the opacity of the pixel in the
+ rasterization.
\sa pathForGlyph(), QPainter::drawGlyphRun()
*/
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index a0e1751..a1b0cb0 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1387,6 +1387,7 @@ QTextEngine::~QTextEngine()
if (!stackEngine)
delete layoutData;
delete specialData;
+ resetFontEngineCache();
}
const HB_CharAttributes *QTextEngine::attributes() const
@@ -1447,6 +1448,13 @@ static inline void releaseCachedFontEngine(QFontEngine *fontEngine)
}
}
+void QTextEngine::resetFontEngineCache()
+{
+ releaseCachedFontEngine(feCache.prevFontEngine);
+ releaseCachedFontEngine(feCache.prevScaledFontEngine);
+ feCache.reset();
+}
+
void QTextEngine::invalidate()
{
freeMemory();
@@ -1455,9 +1463,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..9362022 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -629,6 +629,7 @@ public:
int lineNumberForTextPosition(int pos);
int positionAfterVisualMovement(int oldPos, QTextCursor::MoveOperation op);
void insertionPointsForLine(int lineNum, QVector<int> &insertionPoints);
+ void resetFontEngineCache();
private:
void setBoundary(int strPos) const;
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 4595ef5..d0c1a0e 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();
}
/*!
@@ -2507,6 +2507,9 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
int pos = *cursorPos;
int itm;
+ const HB_CharAttributes *attributes = eng->attributes();
+ while (pos < line.from + line.length && !attributes[pos].charStop)
+ pos++;
if (pos == line.from + (int)line.length) {
// end of line ensure we have the last item on the line
itm = eng->findItem(pos-1);