aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
diff options
context:
space:
mode:
authorCharles Yin <charles.yin@nokia.com>2012-05-16 16:05:06 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-17 01:13:28 +0200
commita03290bd7e988294ec8167dc17865bb94b478f7b (patch)
tree12870b03e7b1d0bf3008c92c4438760d61a56250 /src/quick/scenegraph
parentb8f732a65ef95406780d43ba2c0245728e342347 (diff)
Only genereate new texture if texture id is 0
Otherwise a new texture would be created for accessing textureId() function everytime and even worse thing is these textures will never been deleted and eventually cause gl out of memory. Change-Id: I349fcf15b5aeabbd9420a8dd645e0fdcc1d256bf Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index 69ae31758b..a380d6ecb2 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -499,7 +499,7 @@ int QSGPlainTexture::textureId() const
// The actual texture and id will be updated/deleted in a later bind()
// or ~QSGPlainTexture so just keep it minimal here.
return 0;
- } else {
+ } else if (m_texture_id == 0){
// Generate a texture id for use later and return it.
glGenTextures(1, &const_cast<QSGPlainTexture *>(this)->m_texture_id);
return m_texture_id;