kwin: If GLTexture::load is called, glxpixmap doesn't need to exist

Signed-off-by: Fredrik Höglund <fredrik@kde.org>
This commit is contained in:
Friedrich Kröner 2011-05-14 18:50:41 +02:00 committed by Fredrik Höglund
parent 93dc4d459c
commit a3962f895d

View file

@ -676,8 +676,9 @@ void SceneOpenGL::Texture::bind()
{
glEnable(mTarget);
glBindTexture(mTarget, mTexture);
if (options->glStrictBinding) {
assert(glxpixmap != None);
// if one of the GLTexture::load functions is called, the glxpixmap doesnt
// have to exist
if (options->glStrictBinding && glxpixmap) {
glXReleaseTexImageEXT(display(), glxpixmap, GLX_FRONT_LEFT_EXT);
glXBindTexImageEXT(display(), glxpixmap, GLX_FRONT_LEFT_EXT, NULL);
setDirty(); // Mipmaps have to be regenerated after updating the texture
@ -694,8 +695,9 @@ void SceneOpenGL::Texture::unbind()
if (hasGLVersion(1, 4, 0)) {
glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, 0.0f);
}
if (options->glStrictBinding) {
assert(glxpixmap != None);
// if one of the GLTexture::load functions is called, the glxpixmap doesnt
// have to exist
if (options->glStrictBinding && glxpixmap) {
glBindTexture(mTarget, mTexture);
glXReleaseTexImageEXT(display(), glxpixmap, GLX_FRONT_LEFT_EXT);
}