@ -283,7 +283,6 @@ void GLTexture::update(const QImage &image, const QPoint &offset, const QRect &s
}
}
unbind ( ) ;
unbind ( ) ;
setDirty ( ) ;
if ( useUnpack ) {
if ( useUnpack ) {
glPixelStorei ( GL_UNPACK_ROW_LENGTH , 0 ) ;
glPixelStorei ( GL_UNPACK_ROW_LENGTH , 0 ) ;
@ -312,7 +311,6 @@ void GLTexture::bind()
if ( d - > s_supportsFramebufferObjects & & d - > m_canUseMipmaps ) {
if ( d - > s_supportsFramebufferObjects & & d - > m_canUseMipmaps ) {
glTexParameteri ( d - > m_target , GL_TEXTURE_MIN_FILTER , GL_LINEAR_MIPMAP_LINEAR ) ;
glTexParameteri ( d - > m_target , GL_TEXTURE_MIN_FILTER , GL_LINEAR_MIPMAP_LINEAR ) ;
glTexParameteri ( d - > m_target , GL_TEXTURE_MAG_FILTER , GL_LINEAR ) ;
glTexParameteri ( d - > m_target , GL_TEXTURE_MAG_FILTER , GL_LINEAR ) ;
glGenerateMipmap ( d - > m_target ) ;
} else {
} else {
// can't use trilinear, so use bilinear
// can't use trilinear, so use bilinear
d - > m_filter = GL_LINEAR ;
d - > m_filter = GL_LINEAR ;
@ -337,6 +335,14 @@ void GLTexture::bind()
}
}
}
}
void GLTexture : : generateMipmaps ( )
{
Q_D ( GLTexture ) ;
if ( d - > m_canUseMipmaps & & d - > s_supportsFramebufferObjects )
glGenerateMipmap ( d - > m_target ) ;
}
void GLTexture : : unbind ( )
void GLTexture : : unbind ( )
{
{
Q_D ( GLTexture ) ;
Q_D ( GLTexture ) ;
@ -460,9 +466,7 @@ void GLTexture::setWrapMode(GLenum mode)
void GLTexturePrivate : : onDamage ( )
void GLTexturePrivate : : onDamage ( )
{
{
if ( m_filter = = GL_LINEAR_MIPMAP_LINEAR & & ! m_filterChanged ) {
// No-op
glGenerateMipmap ( m_target ) ;
}
}
}
void GLTexture : : setDirty ( )
void GLTexture : : setDirty ( )