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>
// 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;