mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 03:12:56 +00:00
optimize QTextureGlyphCache
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
0cc78ae59e
commit
9dee62017f
1 changed files with 6 additions and 6 deletions
|
@ -213,9 +213,9 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
|
||||||
}
|
}
|
||||||
|
|
||||||
// now actually use the coords and paint the wanted glyps into cache.
|
// now actually use the coords and paint the wanted glyps into cache.
|
||||||
QHash<GlyphAndSubPixelPosition, Coord>::iterator iter = listItemCoordinates.begin();
|
QHash<GlyphAndSubPixelPosition, Coord>::const_iterator iter = listItemCoordinates.constBegin();
|
||||||
int requiredWidth = m_w;
|
int requiredWidth = m_w;
|
||||||
while (iter != listItemCoordinates.end()) {
|
while (iter != listItemCoordinates.constEnd()) {
|
||||||
Coord c = iter.value();
|
Coord c = iter.value();
|
||||||
|
|
||||||
m_currentRowHeight = qMax(m_currentRowHeight, c.h + margin * 2);
|
m_currentRowHeight = qMax(m_currentRowHeight, c.h + margin * 2);
|
||||||
|
@ -260,8 +260,8 @@ void QTextureGlyphCache::fillInPendingGlyphs()
|
||||||
int requiredHeight = m_h;
|
int requiredHeight = m_h;
|
||||||
int requiredWidth = m_w; // Use a minimum size to avoid a lot of initial reallocations
|
int requiredWidth = m_w; // Use a minimum size to avoid a lot of initial reallocations
|
||||||
{
|
{
|
||||||
QHash<GlyphAndSubPixelPosition, Coord>::iterator iter = m_pendingGlyphs.begin();
|
QHash<GlyphAndSubPixelPosition, Coord>::const_iterator iter = m_pendingGlyphs.constBegin();
|
||||||
while (iter != m_pendingGlyphs.end()) {
|
while (iter != m_pendingGlyphs.constEnd()) {
|
||||||
Coord c = iter.value();
|
Coord c = iter.value();
|
||||||
requiredHeight = qMax(requiredHeight, c.y + c.h);
|
requiredHeight = qMax(requiredHeight, c.y + c.h);
|
||||||
requiredWidth = qMax(requiredWidth, c.x + c.w);
|
requiredWidth = qMax(requiredWidth, c.x + c.w);
|
||||||
|
@ -277,8 +277,8 @@ void QTextureGlyphCache::fillInPendingGlyphs()
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
QHash<GlyphAndSubPixelPosition, Coord>::iterator iter = m_pendingGlyphs.begin();
|
QHash<GlyphAndSubPixelPosition, Coord>::const_iterator iter = m_pendingGlyphs.constBegin();
|
||||||
while (iter != m_pendingGlyphs.end()) {
|
while (iter != m_pendingGlyphs.constEnd()) {
|
||||||
GlyphAndSubPixelPosition key = iter.key();
|
GlyphAndSubPixelPosition key = iter.key();
|
||||||
fillTexture(iter.value(), key.glyph, key.subPixelPosition);
|
fillTexture(iter.value(), key.glyph, key.subPixelPosition);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue