Change some of the debug messages to warnings, so compositing setup failures

show up also in release builds.


svn path=/trunk/KDE/kdebase/workspace/; revision=762175
icc-effect-5.14.5
Luboš Luňák 2008-01-16 12:44:45 +00:00
parent aafbb87285
commit 110f76ecd8
5 changed files with 22 additions and 12 deletions

View File

@ -84,7 +84,7 @@ void Workspace::setupCompositing()
}
else if( !CompositingPrefs::compositingPossible() )
{
kDebug( 1212 ) << "Compositing isn't possible";
kWarning( 1212 ) << "Compositing is not possible";
return;
}
if( scene != NULL )
@ -147,7 +147,7 @@ void Workspace::setupCompositing()
}
if( scene == NULL || scene->initFailed())
{
kDebug( 1212 ) << "Failed to create Scene object. Compositing disabled" << endl;
kError( 1212 ) << "Failed to initialize compositing, compositing disabled" << endl;
delete scene;
scene = NULL;
delete cm_selection;

View File

@ -99,11 +99,15 @@ bool hasGLExtension(const QString& extension)
return glExtensions.contains(extension) || glxExtensions.contains(extension);
}
void checkGLError( const char* txt )
bool checkGLError( const char* txt )
{
GLenum err = glGetError();
if( err != GL_NO_ERROR )
{
kWarning() << "GL error (" << txt << "): 0x" << QString::number( err, 16 ) ;
return true;
}
return false;
}
int nearestPowerOfTwo( int x )

View File

@ -61,7 +61,7 @@ bool KWIN_EXPORT hasGLXVersion(int major, int minor, int release = 0);
bool KWIN_EXPORT hasGLExtension(const QString& extension);
// detect OpenGL error (add to various places in code to pinpoint the place)
void KWIN_EXPORT checkGLError( const char* txt );
bool KWIN_EXPORT checkGLError( const char* txt );
inline bool KWIN_EXPORT isPowerOfTwo( int x ) { return (( x & ( x - 1 )) == 0 ); }
/**

View File

@ -125,7 +125,7 @@ SceneOpenGL::SceneOpenGL( Workspace* ws )
!glXGetVisualFromFBConfig || !glXCreatePixmap || !glXDestroyPixmap ||
!glXCreateWindow || !glXDestroyWindow )
{
kDebug( 1212 ) << "GLX_SGIX_fbconfig or required GLX functions missing";
kWarning( 1212 ) << "GLX_SGIX_fbconfig or required GLX functions missing";
return; // error
}
if( !selectMode())
@ -162,7 +162,11 @@ SceneOpenGL::SceneOpenGL( Workspace* ws )
glOrtho( 0, displayWidth(), displayHeight(), 0, 0, 65535 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
checkGLError( "Init" );
if( checkGLError( "Init" ))
{
kWarning( 1212 ) << "OpenGL compositing setup failed";
return; // error
}
kDebug( 1212 ) << "DB:" << db << ", TFP:" << tfp_mode << ", SHM:" << shm_mode
<< ", Direct:" << bool( glXIsDirect( display(), ctxbuffer )) << endl;
init_ok = true;
@ -363,7 +367,7 @@ bool SceneOpenGL::initBuffer()
}
else
{
kDebug( 1212 ) << "Couldn't create output buffer (failed to create overlay window?) !";
kWarning( 1212 ) << "Couldn't create output buffer (failed to create overlay window?) !";
return false; // error
}
return true;
@ -445,7 +449,7 @@ bool SceneOpenGL::initBufferConfigs()
XFree( fbconfigs );
if( fbcbuffer_db == NULL && fbcbuffer_nondb == NULL )
{
kDebug( 1212 ) << "Couldn't find framebuffer configuration for buffer!";
kWarning( 1212 ) << "Couldn't find framebuffer configuration for buffer!";
return false;
}
return true;
@ -558,12 +562,12 @@ bool SceneOpenGL::initDrawableConfigs()
XFree( fbconfigs );
if( fbcdrawableinfo[ DefaultDepth( display(), DefaultScreen( display())) ].fbconfig == NULL )
{
kDebug( 1212 ) << "Couldn't find framebuffer configuration for default depth!";
kWarning( 1212 ) << "Couldn't find framebuffer configuration for default depth!";
return false;
}
if( fbcdrawableinfo[ 32 ].fbconfig == NULL )
{
kDebug( 1212 ) << "Couldn't find framebuffer configuration for depth 32!";
kWarning( 1212 ) << "Couldn't find framebuffer configuration for depth 32!";
return false;
}
return true;

View File

@ -87,12 +87,12 @@ SceneXrender::SceneXrender( Workspace* ws )
{
if( !Extensions::renderAvailable())
{
kDebug( 1212 ) << "No xrender extension available";
kWarning( 1212 ) << "No XRender extension available";
return;
}
if( !Extensions::fixesRegionAvailable())
{
kDebug( 1212 ) << "No xfixes v3+ extension available";
kWarning( 1212 ) << "No XFixes v3+ extension available";
return;
}
KXErrorHandler xerr;
@ -113,6 +113,8 @@ SceneXrender::SceneXrender( Workspace* ws )
}
createBuffer();
init_ok = !xerr.error( true );
if( !init_ok )
kWarning( 1212 ) << "XRender compositing setup failed";
}
SceneXrender::~SceneXrender()