aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@nokia.com>2011-12-13 11:18:33 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-14 09:06:21 +0100
commit17bffaa4d447959f08e16ca9a45885f631a16cc0 (patch)
treed5a014dd626e2fc07179938eedde661357cb5663 /src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
parent22a8387aeab93fd086b297443945487677aef280 (diff)
More distance-field cache refactoring.
The distance field glyph node now uses preprocess(). The glyph cache is updated at that time, then when all the glyphs are ready the node's geometry is updated. addGlyphPositions and addGlyphTextures in QSGDistanceFieldGlyphCache have been renamed to setGlyphsPosition and setGlyphsTexture to reflect the fact that they can be used to update existing glyphs. For example when a glyph has moved to a different texture. When an existing glyph is updated, all nodes containing that glyph are invalidated and their geometries are reconstructed with the new values. Change-Id: I7758313155f48811e6027434e6c9a1c3df5dfab7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp')
-rw-r--r--src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
index 95ccc8f437..4f69ad8c44 100644
--- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
+++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
@@ -117,7 +117,7 @@ void QSGDefaultDistanceFieldGlyphCache::requestGlyphs(const QVector<glyph_t> &gl
}
}
- addGlyphPositions(glyphPositions);
+ setGlyphsPosition(glyphPositions);
markGlyphsToRender(glyphsToRender);
}
@@ -159,7 +159,7 @@ void QSGDefaultDistanceFieldGlyphCache::storeGlyphs(const QHash<glyph_t, QImage>
Texture t;
t.textureId = m_textureData->texture;
t.size = m_textureData->size;
- addGlyphTextures(glyphTextures, t);
+ setGlyphsTexture(glyphTextures, t);
}
void QSGDefaultDistanceFieldGlyphCache::releaseGlyphs(const QVector<glyph_t> &glyphs)
@@ -300,6 +300,9 @@ void QSGDefaultDistanceFieldGlyphCache::resizeTexture(int width, int height)
glEnable(GL_BLEND);
glViewport(viewport[0], viewport[1], viewport[2], viewport[3]);
ctx->functions()->glUseProgram(oldProgram);
+
+ m_textureData->blitProgram->disableAttributeArray(int(QT_VERTEX_COORDS_ATTR));
+ m_textureData->blitProgram->disableAttributeArray(int(QT_TEXTURE_COORDS_ATTR));
}
bool QSGDefaultDistanceFieldGlyphCache::useWorkaroundBrokenFBOReadback() const