Try to get a FBO in the init method of GLRenderTarget. If the FBO is incomplete there is no need to claim that the driver supports FBO.

This is a workaround to the problem that some drivers do not return a complete FBO, but support the extension. Which caused the blur effect to get loaded without working and in consequence Plasma to use the blur-optimized and very translucent backgrounds.
CCBUG: 240956

svn path=/trunk/KDE/kdebase/workspace/; revision=1137490
icc-effect-5.14.5
Martin Gräßlin 2010-06-13 07:40:21 +00:00
parent 633d80001f
commit cf3bcc6294
1 changed files with 20 additions and 0 deletions

View File

@ -971,6 +971,26 @@ bool GLRenderTarget::mSupported = false;
void GLRenderTarget::initStatic()
{
mSupported = hasGLExtension("GL_EXT_framebuffer_object") && glFramebufferTexture2D;
if( mSupported )
{
// some drivers claim to support the extension, but fail to return a complete FBO (see Bug 240956)
// generate a FBO and test if it is valid. If it isn't valid there's no need to claim that FBO's are supported
int w = displayWidth();
int h = displayHeight();
if ( !GLTexture::NPOTTextureSupported() )
{
w = nearestPowerOfTwo( w );
h = nearestPowerOfTwo( h );
}
GLTexture* tex = new GLTexture( w, h );
tex->setFilter( GL_LINEAR );
tex->setWrapMode( GL_CLAMP_TO_EDGE );
GLRenderTarget* target = new GLRenderTarget( tex );
if( !target->valid() )
mSupported = false;
delete target;
delete tex;
}
}
GLRenderTarget::GLRenderTarget(GLTexture* color)