XRenderUtils are split out of kwineffects and are an own library just
like kwinglutils is an own library.
The library gets always build and is linked in KWin core unconditionally
(as it's used in outline) and conditionally in kwineffects (PaintClipper)
and the built in effects depending on XRender build option.
KWin already has a de facto OpenGL 2 dependency through QML. Combined
with the fact that the OpenGL 1 backend is basically unmaintained and
also unused, it's better to remove it for the new major release.
This change includes:
* Removal of cmake option KWIN_BUILD_OPENGL_1_COMPOSITING
* Removal of KWIN_HAVE_OPENGL_1 compile option and all code
ifdef'ed with it (partially removal of if-else constructs)
* Removal of CompositingType::OpenGL1Compositing (flags are kept
as a core flag should get introduced)
* Driver recommendation for OpenGL1Compositing changed to XRender
(should be evaluated whether the drivers can provide GL2)
* Removal of configuration option "GLLegacy"
* Removal of fooMatrix function in kwinglutils
* Removal of ARBBlurShader
* Removal of legacy code path in GLVertexBuffer
* Removal of GLShaderManager::disable
* if-blocks with ShaderManager::instance()->isValid() removed
REVIEW: 116042
Only needs:
* Qt5::DBus for the communication with color correction
* Qt5::X11Extras for access to XCB, pulls in needed Qt5::Gui
* XCB component XCB for xcb calls in kwinglobals.h
It's basically a run of the port-cmake.sh script in here, mostly the changes
are the following:
- Using KF5::* targets
- Using the proper macros, following recent developments in frameworks
As KWin indirectly uses Qt's OpenGL through QtQuick we need to ensure
to not mix OpenGL and OpenGLES. So we have to built KWin only against
OpenGL if Qt is built against OpenGL and we have to built KWin only
against GLESv2 if Qt is built against GLESv2.
This means the kwin_gles binary is no more. There is only kwin which
either links GL or GLESv2.
Using a lib variable for:
* own libs
* qt libs
* kde libs
* xlib libs
* xcb libs
and link those groups together in target_link_libraries. This should
make the code easier to read and easier to support in future for some
time both Qt4 and Qt5.
The extension handling is removed from kwinglobals and moved into the
xcbutils in KWin core in namespace KWin::Xcb. The motivation for this
change is that the Extensions are only used in KWin core and are marked
as internal. So there is no need to have them in the library.
What remains in Extensions are the non-native pixmaps. This will be
removed once we are on Qt 5 as QPixmap can no longer reference an XPixmap.
The remaining code in kwinglobals also still initialize the XLib versions
of extensions emitting events. It seems like there are no XEvents emitted
if not done so even if the extension is correctly initialized with xcb.
This needs to be removed once the event handling is ported over to xcb.
REVIEW: 107832
Add an option to kcmcompositing in the 'Advanced' tab, to enable or
disable color correction. It is specified that it's experimental and it
needs Kolor Manager.
Before painting for a particular screen, ColorCorrection::setupForOutput
should be called.
A screen property is added for WindowPaintData.
In kwinglutils, The fragment shaders are intercepted before being
compiled and they get a couple of lines of code inserted in order to do
the color correction. This happens only when color correction is enabled, of
course.
For D-Bus communication with KolorServer, everything is async.
The implementation basically manages a set of color lookup tables for
different outputs and for different window regions. These are taken via
D-Bus. Each lookup table has around 700 KB.
This commit reintroduces the changes from the former merge with the
"color2" branch. In this form, it can be easily reverted.
REVIEW: 106141
This merge is incomplete and it does not include the review number of
the associated review request. It should have been pushed as a single
commit, because the merged commits were not intended to be published in
their form.
This reverts commit dcba90263069a221a5489b1915c5cf1ca39d090c, reversing
changes made to 50ae07525c7fde07794e7548c3d6e5a69cb1a89d.
Conflicts:
kwin/scene_opengl.cpp
kwin/scene_opengl.h
If the build option is enabled KWIN_HAVE_OPENGL_1 is passed as a compile
flag when build against OpenGL.
This compile flag is meant to replace the KWIN_HAVE_OPENGLES. So far code
has been ifdefed for special behavior of OpenGL ES 2.0 and to remove
fixed functionality calls which are not available in OpenGL ES 2.0.
With this build flag the fixed functionality calls which are only used in
the OpenGL1 Compositor can be removed and keeping the KWIN_HAVE_OPENGLES
for the real differences between OpenGL 2.x and OpenGL ES 2.0.
E.g. a call like glColor4f should be in an
glColor4f(1.0, 1.0, 1.0, 1.0);
while a call like glPolygonMode should be in an
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
Building for OpenGL ES 2.0 of course implies that KWIN_HAVE_OPENGL_1 is
not defined.
The Egl backend is decoupled from the OpenGL ES build option which makes
it possible to use it as a replacement for glx.
To make this possible a new build flag is added when egl is available at
compile time and any egl specific code is now ifdefed with this flag
instead of the gles flag. In addition at runtime a windowing system enum
value is passed to the various detect methods to have egl/glx specific
detection for e.g. function pointer resolving.
By default egl is used if compiled with OpenGL ES, otherwise glx is used.
But in the non-gles case the windowing system can be selected through the
new environment variable KWIN_OPENGL_INTERFACE. Setting this variable to
"egl" the EglOnXBackend is used.
REVIEW: 106632
The implementation consists of a class in libkwineffects.
There are some slight modifications in the compositor. Regions for
different outputs are drawn at different times.
Currently only per output color correction is implemented. However, the
grounds are prepared for implementing per window color correction
easily.
The ColorCorrection class needs to communicate via D-Bus with a KDED
module, KolorServer, which is a part of KolorManager.
The only visible part for the user consists of a check box in the
advanced tab for the compositing KCM.
The actual correction is done by injecting a piece of code in the
fragment shader, code that does a 3D lookup into a special color lookup
texture. The data for these textures is obtained from KolorServer. All
D-Bus calls are async.
A CMake variable is used to specify the name of the binary.
By default this is "kwin" but building for PA changes the
name to "kwinactive". The variable adjusts all names, e.g.
kwinnvidiahack becomes kwinactivenvidiahack.
The remaining usage of kwinrc in core and libs is replaced
by a cmakedefine for the configuration name and all data
installations are moved to the defined name. Dynamic loading
for scripts & co is adjusted for loading based on defined name.
This change allows the side-by-side installation of both kwin
for desktop and kwin for Plasma Desktop without the known
issues like conflicts in config files or missing build options
if kwin desktop is used for Plasma Active.
Likewise the KCMs are not adjusted as they are not intended to
be used for kwinactive.
REVIEW: 104299
BUG: 296084
FIXED-IN: 4.9.0
CCMAIL: active@kde.org
if both the GLES and EGL libs and headers are found.
Fold all the includes and libraries into 1 varaible each and use those.
in other words, you need to have both OpenGLES and EGL to do a successful build.
All OpenGL related files are build as a kwinglutils library for OpenGL
and as a kwinglesutils library for OpenGL ES. The appropriate defines
are set using target_properties and removed from kwinconfig.h.cmake.