Port QTextureGlyphCache to qsizetype

Reduces impedance mismatch with other Qt containers.

Pick-to: 6.4
Task-number: QTBUG-104820
Change-Id: Ie8830a404240f34acc790296b608e1318c46535d
Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
This commit is contained in:
Marc Mutz 2022-07-08 10:04:12 +02:00
parent 3f32e4a73a
commit 9d29c590f3
2 changed files with 5 additions and 5 deletions

View File

@ -57,14 +57,14 @@ int QTextureGlyphCache::calculateSubPixelPositionCount(glyph_t glyph) const
}
bool QTextureGlyphCache::populate(QFontEngine *fontEngine,
int numGlyphs,
qsizetype numGlyphs,
const glyph_t *glyphs,
const QFixedPoint *positions,
QPainter::RenderHints renderHints,
bool includeGlyphCacheScale)
{
#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;
#endif
@ -79,7 +79,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine,
if (!supportsSubPixelPositions) {
fontEngine->m_subPixelPositionCount = 1;
} else {
int i = 0;
qsizetype i = 0;
while (fontEngine->m_subPixelPositionCount == 0 && i < numGlyphs)
fontEngine->m_subPixelPositionCount = calculateSubPixelPositionCount(glyphs[i++]);
}
@ -97,7 +97,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine,
int rowHeight = 0;
// 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];
QFixedPoint subPixelPosition;

View File

@ -75,7 +75,7 @@ public:
};
bool populate(QFontEngine *fontEngine,
int numGlyphs,
qsizetype numGlyphs,
const glyph_t *glyphs,
const QFixedPoint *positions,
QPainter::RenderHints renderHints = QPainter::RenderHints(),