diff options
author | Yoann Lopes <yoann.lopes@nokia.com> | 2011-08-24 11:48:57 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-24 15:15:46 +0200 |
commit | 9f14876efbb19f2a8f0e39e8b37ae12def8275ab (patch) | |
tree | f325a8fc292e3e674f3ad4617e638ab18de74c6d | |
parent | 12d2877ac0ed64caf9f40f157e687ae58ebbd674 (diff) |
Slightly reduce distance-field texture creation (and resizing) time.
Pass a null pointer to glTexImage2D instead of a zero-filled array.
Change-Id: I8428b26a83a3f88ad2ee07e56e5cdb09ee5de68a
Reviewed-on: http://codereview.qt.nokia.com/3492
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
-rw-r--r-- | src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp b/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp index 73a2d2a65c..ff4913a7b5 100644 --- a/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp +++ b/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp @@ -1053,10 +1053,7 @@ void QSGDistanceFieldGlyphCache::createTexture(int width, int height) glGenTextures(1, &m_textureData->texture); glBindTexture(GL_TEXTURE_2D, m_textureData->texture); - QVarLengthArray<uchar> data(width * height); - for (int i = 0; i < data.size(); ++i) - data[i] = 0; - glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, &data[0]); + glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |