Port QTextureGlyphCache to qsizetype
Reduces impedance mismatch with other Qt containers. Task-number: QTBUG-104820 Change-Id: Ie8830a404240f34acc790296b608e1318c46535d Reviewed-by: Lars Knoll <lars.knoll@gmail.com> (cherry picked from commit 9d29c590f30a04b3dba0b7d1b4918c2db5419e0d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
5fb843bfae
commit
c677238643
@ -57,14 +57,14 @@ int QTextureGlyphCache::calculateSubPixelPositionCount(glyph_t glyph) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool QTextureGlyphCache::populate(QFontEngine *fontEngine,
|
bool QTextureGlyphCache::populate(QFontEngine *fontEngine,
|
||||||
int numGlyphs,
|
qsizetype numGlyphs,
|
||||||
const glyph_t *glyphs,
|
const glyph_t *glyphs,
|
||||||
const QFixedPoint *positions,
|
const QFixedPoint *positions,
|
||||||
QPainter::RenderHints renderHints,
|
QPainter::RenderHints renderHints,
|
||||||
bool includeGlyphCacheScale)
|
bool includeGlyphCacheScale)
|
||||||
{
|
{
|
||||||
#ifdef CACHE_DEBUG
|
#ifdef CACHE_DEBUG
|
||||||
printf("Populating with %d glyphs\n", numGlyphs);
|
printf("Populating with %lld glyphs\n", static_cast<long long>(numGlyphs));
|
||||||
qDebug() << " -> current transformation: " << m_transform;
|
qDebug() << " -> current transformation: " << m_transform;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine,
|
|||||||
if (!supportsSubPixelPositions) {
|
if (!supportsSubPixelPositions) {
|
||||||
fontEngine->m_subPixelPositionCount = 1;
|
fontEngine->m_subPixelPositionCount = 1;
|
||||||
} else {
|
} else {
|
||||||
int i = 0;
|
qsizetype i = 0;
|
||||||
while (fontEngine->m_subPixelPositionCount == 0 && i < numGlyphs)
|
while (fontEngine->m_subPixelPositionCount == 0 && i < numGlyphs)
|
||||||
fontEngine->m_subPixelPositionCount = calculateSubPixelPositionCount(glyphs[i++]);
|
fontEngine->m_subPixelPositionCount = calculateSubPixelPositionCount(glyphs[i++]);
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine,
|
|||||||
int rowHeight = 0;
|
int rowHeight = 0;
|
||||||
|
|
||||||
// check each glyph for its metrics and get the required rowHeight.
|
// check each glyph for its metrics and get the required rowHeight.
|
||||||
for (int i=0; i < numGlyphs; ++i) {
|
for (qsizetype i = 0; i < numGlyphs; ++i) {
|
||||||
const glyph_t glyph = glyphs[i];
|
const glyph_t glyph = glyphs[i];
|
||||||
|
|
||||||
QFixedPoint subPixelPosition;
|
QFixedPoint subPixelPosition;
|
||||||
|
@ -75,7 +75,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool populate(QFontEngine *fontEngine,
|
bool populate(QFontEngine *fontEngine,
|
||||||
int numGlyphs,
|
qsizetype numGlyphs,
|
||||||
const glyph_t *glyphs,
|
const glyph_t *glyphs,
|
||||||
const QFixedPoint *positions,
|
const QFixedPoint *positions,
|
||||||
QPainter::RenderHints renderHints = QPainter::RenderHints(),
|
QPainter::RenderHints renderHints = QPainter::RenderHints(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user