aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@nokia.com>2011-08-24 11:48:57 +0200
committerQt by Nokia <qt-info@nokia.com>2011-08-24 15:15:46 +0200
commit9f14876efbb19f2a8f0e39e8b37ae12def8275ab (patch)
treef325a8fc292e3e674f3ad4617e638ab18de74c6d
parent12d2877ac0ed64caf9f40f157e687ae58ebbd674 (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.cpp5
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);