From 2fc0b8074b4fe84a4080900fc498f2a6a995c81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 29 Apr 2012 08:18:18 +0200 Subject: [PATCH] Move detection of GLPlatform and printResults into Scene This means the GLPlatform is filled with values from the context actually used for Compositing and if XRender compositing is used no OpenGL information is logged. --- compositingprefs.cpp | 14 +------------- compositingprefs.h | 2 -- scene_opengl_egl.cpp | 3 +++ scene_opengl_glx.cpp | 4 +++- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/compositingprefs.cpp b/compositingprefs.cpp index 187435eea7..1650133ca1 100644 --- a/compositingprefs.cpp +++ b/compositingprefs.cpp @@ -157,9 +157,6 @@ void CompositingPrefs::detect() if (!haveContext) { canDetect = initEGLContext(); } - if (canDetect) { - detectDriverAndVersion(); - } if (!haveContext) { deleteEGLContext(); } @@ -202,9 +199,7 @@ void CompositingPrefs::detect() if (hasglx13) oldreaddrawable = glXGetCurrentReadDrawable(); - if (initGLXContext()) { - detectDriverAndVersion(); - } + initGLXContext(); if (hasglx13) glXMakeContextCurrent(display(), olddrawable, oldreaddrawable, oldcontext); else @@ -365,12 +360,5 @@ void CompositingPrefs::deleteEGLContext() #endif } -void CompositingPrefs::detectDriverAndVersion() -{ - GLPlatform *gl = GLPlatform::instance(); - gl->detect(); - gl->printResults(); -} - } // namespace diff --git a/compositingprefs.h b/compositingprefs.h index a0dbc2458d..ec4e47a2c3 100644 --- a/compositingprefs.h +++ b/compositingprefs.h @@ -58,8 +58,6 @@ public: protected: - void detectDriverAndVersion(); - bool initGLXContext(); void deleteGLXContext(); bool initEGLContext(); diff --git a/scene_opengl_egl.cpp b/scene_opengl_egl.cpp index d0ce3608c4..87690bff8d 100644 --- a/scene_opengl_egl.cpp +++ b/scene_opengl_egl.cpp @@ -42,6 +42,9 @@ SceneOpenGL::SceneOpenGL(Workspace* ws) kError(1212) << "Required support for binding pixmaps to EGLImages not found, disabling compositing"; return; } + GLPlatform *glPlatform = GLPlatform::instance(); + glPlatform->detect(); + glPlatform->printResults(); initGL(); if (!hasGLExtension("GL_OES_EGL_image")) { kError(1212) << "Required extension GL_OES_EGL_image not found, disabling compositing"; diff --git a/scene_opengl_glx.cpp b/scene_opengl_glx.cpp index e75275aaa1..1ec57631d3 100644 --- a/scene_opengl_glx.cpp +++ b/scene_opengl_glx.cpp @@ -55,9 +55,11 @@ SceneOpenGL::SceneOpenGL(Workspace* ws) if (!initRenderingContext()) return; // error // Initialize OpenGL + GLPlatform *glPlatform = GLPlatform::instance(); + glPlatform->detect(); + glPlatform->printResults(); initGL(); - GLPlatform *glPlatform = GLPlatform::instance(); if (glPlatform->isSoftwareEmulation()) { kError(1212) << "OpenGL Software Rasterizer detected. Falling back to XRender."; QTimer::singleShot(0, Workspace::self(), SLOT(fallbackToXRenderCompositing()));