2007-11-27 19:40:25 +00:00
|
|
|
/********************************************************************
|
2007-09-18 13:59:06 +00:00
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2007 Rivo Laks <rivolaks@hot.ee>
|
|
|
|
|
2007-11-27 19:40:25 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
2007-09-18 13:59:06 +00:00
|
|
|
|
|
|
|
#ifndef KWIN_COMPOSITINGPREFS_H
|
|
|
|
#define KWIN_COMPOSITINGPREFS_H
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
#include "kwinglutils.h"
|
2008-10-15 13:41:53 +00:00
|
|
|
#include "kwinglobals.h"
|
2007-09-18 13:59:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
class CompositingPrefs
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CompositingPrefs();
|
|
|
|
~CompositingPrefs();
|
|
|
|
|
2007-09-26 16:34:08 +00:00
|
|
|
static bool compositingPossible();
|
2007-11-12 16:32:25 +00:00
|
|
|
static QString compositingNotPossibleReason();
|
2011-04-03 19:59:57 +00:00
|
|
|
static bool openGlIsBroken();
|
2011-07-20 20:10:03 +00:00
|
|
|
/**
|
|
|
|
* Tests whether GLX is supported and returns @c true
|
|
|
|
* in case KWin is compiled with OpenGL support and GLX
|
|
|
|
* is available.
|
|
|
|
*
|
|
|
|
* If KWin is compiled with OpenGL ES or without OpenGL at
|
|
|
|
* all, @c false is returned.
|
|
|
|
* @returns @c true if GLX is available, @c false otherwise and if not build with OpenGL support.
|
|
|
|
**/
|
|
|
|
static bool hasGlx();
|
2009-12-04 09:29:08 +00:00
|
|
|
bool recommendCompositing() const;
|
2011-01-30 14:34:42 +00:00
|
|
|
bool enableVSync() const {
|
|
|
|
return mEnableVSync;
|
|
|
|
}
|
|
|
|
bool enableDirectRendering() const {
|
|
|
|
return mEnableDirectRendering;
|
|
|
|
}
|
|
|
|
bool strictBinding() const {
|
|
|
|
return mStrictBinding;
|
|
|
|
}
|
2007-09-18 13:59:06 +00:00
|
|
|
|
|
|
|
void detect();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
void detectDriverAndVersion();
|
|
|
|
void applyDriverSpecificOptions();
|
|
|
|
|
2008-01-22 17:04:41 +00:00
|
|
|
bool initGLXContext();
|
2007-09-18 13:59:06 +00:00
|
|
|
void deleteGLXContext();
|
2010-12-12 11:08:23 +00:00
|
|
|
bool initEGLContext();
|
|
|
|
void deleteEGLContext();
|
2007-09-18 13:59:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
private:
|
2009-12-04 09:29:08 +00:00
|
|
|
bool mRecommendCompositing;
|
2007-09-18 13:59:06 +00:00
|
|
|
bool mEnableVSync;
|
|
|
|
bool mEnableDirectRendering;
|
2007-10-17 15:37:14 +00:00
|
|
|
bool mStrictBinding;
|
2007-09-18 13:59:06 +00:00
|
|
|
|
2010-12-12 11:08:23 +00:00
|
|
|
#ifdef KWIN_HAVE_OPENGLES
|
|
|
|
EGLDisplay mEGLDisplay;
|
|
|
|
EGLContext mEGLContext;
|
|
|
|
EGLSurface mEGLSurface;
|
|
|
|
#else
|
2007-09-18 13:59:06 +00:00
|
|
|
GLXContext mGLContext;
|
2007-09-18 14:48:01 +00:00
|
|
|
#endif
|
2010-12-12 11:08:23 +00:00
|
|
|
Window mGLWindow;
|
2007-09-18 13:59:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //KWIN_COMPOSITINGPREFS_H
|
|
|
|
|
|
|
|
|