Adjustment to reality. KWin has had a dependency on Mesa 8.0 for quite
some time given that it is what basically all distributions ship.
It is better to clearly state what is required. For KWin Mesa 8.0 is a
more reliable dependency as all DRI drivers which do not support DRI2
have been removed.
Packagers have been informed about this intended change some weeks ago.
REVIEW: 106799
During detecting the OpenGL capabilities also a recommended compositor
can be set. This recommendation is honoured by the OpenGL based
compositors. That is the SceneOpenGL2 requires a recommendation for at
least OpenGL2 and the SceneOpenGL1 requires at least a recommendation for
OpenGL1. If the driver recommends XRender compositing the SceneOpenGL
performs the existing fallback to XRender.
With this recommendation the hacks in the Scene are removed, e.g. it is
no longer checked whether the driver is software emulation as that is
provided through the recommendation.
To overrule the recommendation the environment variable KWIN_COMPOSE is
extended by the values O1 and O2 to enforce either OpenGL 1 or OpenGL 2.
This overwrites all other checks. As a side-effect this allows now to run
KWin on the llvmpipe:
LIBGL_ALWAYS_SOFTWARE=1 KWIN_COMPOSE=O2 kwin --replace &
But not that I would recommend to use it :-)
REVIEW: 106741
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.
VMware uses a Gallium driver which means that OpenGL based compositing
works out of the box without any adjustments to GLPlatform.
Just adding recognizing code for the SVGA3D driver.
REVIEW: 106826
OpenGL is properly working if there is a direct rendering context.
If LIBGL_ALWAYS_INDIRECT is set VirtualBox falls back to Mesa's software
rasterizer. So in order to get OpenGL the driver is now whitelisted in
the opengltest.
GLPlatform is extended to recognize the VirtualBox driver and has new
methods to report whether it is a virtual machine and VirtualBox. The
detection is rather limited as we don't get access to the underlying
hardware, so we do not know whether the features are really supported.
We need to trust the driver here in announcing the right extensions.
The driver does not provide glxQueryDrawable although it is part of
GLX 1.3. A hack is added in the glxbackend to set the function pointer to
NULL. This can unfortunately not be done in glxResolveFunctions() as
QueryDrawable seems not to be provided by an extension (at least not
listed in the OpenGL registry) and getProcAddress resolves a function but
it only prints an OpenGL Warning to stderr.
As a note: the driver reports that it is using XSHM for
GLX_EXT_texture_from_pixmap.
REVIEW: 106821
Note to me: always rebuild with all possible build options if something
is changed.
Sorry for the inconvenience and thanks to the early report of the issue.
BUG: 307866
FIXED-IN: 4.10
According to the OpenGL ABI for Linux GLX 1.3 is a minimum requirement.
Therefore we do not need to resolve the symbols which are present in that
version.
KWin did always require at least 1.3, for all the resolved functions
there were checks in the Scene, but they might have been incorrect.
Instead now the GLX version is checked and OpenGL compositing is blocked
if there is not at least GLX 1.3.
REVIEW: 106704
glBlendColor has been added to OpenGL 1.2 which means it is part of
the OpenGL ABI defined for Linux.
See http://www.opengl.org/registry/ABI/ section 3.4.
The macro GL_RESOLVE_WITH_EXT was fundamentally broken as it tried to
resolve a symbol first by it's name and then by the extension name if
the returned pointer is null.
From GLX spec:
"A non-NULL return value for glXGetProcAddress does not guarantee that an
extension function is actually supported at runtime. The client must also query
glGetString(GL EXTENSIONS) or glXQueryExtensionsString to determine if an
extension is supported by a particular context."
This macro is now reworked to be used only in case the symbol name does
not match our function name. E.g. glUniform1f vs glUniform1fARB.
The resolving itself also had quite some issues as:
* in same cases function pointers are not nulled
* in same cases only the arb or only the ext is checked
* in same cases the wrong extension is checked
This is now reworked to always check first the ARB extension if available
then the EXT extension and if both are not available the pointers are set
to NULL.
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 ShaderBinder class can be used for the case that a block of code
should be executed with a given Shader being bound. This is useful for
all the cases where there is a if-block for OpenGL2 execution with a
Shader being pushed in the first line to the ShaderManager and popped in
the last line of the block. With the helper this can be simplified to:
ShaderBinder binder(myCustomShader);
or
ShaderBinder binder(ShaderManager::GenericShader);
The ctor of ShaderBinder pushes the given Shader to the stack and once
the helper goes out of scope it will be popped again from the stack.
In addition the helper can take care of OpenGL 1 compositing, that is it
just does nothing. So it can also be used where there is a shared OpenGL1
and OpenGL2 code path where the Shader should only be pushed in OpenGL2.
This basically removes all the checks for the compositing type before
pushing/popping a Shader to the stack.
REVIEW: 106521
The main usage of ShaderManager::isValid was to have OpenGL2 specific
code pathes. Now we have an actual OpenGL2Compositing type and we know
that the ShaderManager is valid if we have this compositing type and we
know that it is not valid on OpenGL1Compositing. This gives us a much
better check and allows us to use the isValid method just for where we
want to check whether the shaders compiled successfully.
In addition some effects require OpenGL2, so we do not need to check
again that the ShaderManager is valid. Such usages are removed.
The CompositingType enum turns into flags and two new values are
introduced: OpenGL1Compositing and OpenGL2Compositing.
Those new values are or-ed to OpenGLCompositing so that a simple check
for the flag OpenGLCompositing works in case of one of those two new
values. To make the generic check for OpenGL compositing easier a method
in EffectsHandler is introduced to just check for this.
The scenes now return either OpenGL1Compositing or OpenGL2Compositing
depending on which Scene implementation. None returns OpenGLCompositing.
SceneOpenGL turns into an abstract class with two concrete subclasses:
* SceneOpenGL1
* SceneOpenGL2
It provides a factory method which first creates either the GLX or EGL
backend which is passed to a static supported() method in the concrete
sub classes. These method can test whether the backend is sufficient to
be used for the OpenGL version in question. E.g. the OpenGL 2 scene
checks whether the context is direct.
The actual rendering is moved into the subclasses with specific OpenGL 1
and OpenGL 2 code. This should make the code more readable and requires
less checks whether a Shader is bound. This is now known through the
Scene: the OpenGL1 scene will never have a shader bound, the OpenGL2 scene
will always have a shader bound.
To make this more reliable the ShaderManager is extended by a disable
method used by SceneOpenGL1 to ensure that the ShaderManager will never
be used. This also obsoletes the need to read the KWin configuration
whether legacy GL is enabled. The check is moved into the supported
method of the OpenGL2 scene.
REVIEW: 106357
Currently the GL Matrix Stack is also used with OpenGL 2.
That is pushMatrix, multMatrix and popMatrix are executed
although this does not influence the rendering at all. The
OpenGL 1 matrices are not passed to the shaders.
With this change the calls to the matrix stack are no longer
executed if the Shader based backend is used. This means we
have a few less matrix multiplications in the rendering.
Mostly affects a few effects which have not yet completely be
ported over to OpenGL 2.
BUG: 303093
FIXED-IN: 4.10
REVIEW: 105455
The public member variables for opacity, saturation and brightness
are removed in favor for getter and setters. The variables are
moved into a private class. Those are now qreal instead of double.
To make usage inside the effects easier a multiply method is added
which multiplies the current value with passed in factor and returns
the new value in a functional programming style.
This commit is the top-most of a patch series to refactor
ScreenPaintData and WindowPaintData. Other related commits are:
* 0811772
* ebdc7ec
* 2c8dd8d
* 7699726
* 68e0201
* 611cb09
REVIEW: 105141
BUG: 303314
FIXED-IN: 4.10
No effect has ever made use of contents opacity. Which means it
is not needed. Removing means faster effects as we used to
multiply the value (always 1.0) with the opacity in each frame
for each window.
New properties for the current activity and the available
activities plus related signals in scripts. Signals added to
effects.
BUG: 302060
FIXED-IN: 4.9.0
m_textureNPOT and m_limitedNPOT have not been initialized in the ctor resulting in
m_limitedNPOT being incorrectly being true sometimes for Intel drivers. For other
drivers the value had been set.
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
Additional TabBox Mode which allows to switch between all open
windows of the current selected application. By default Alt+tilde
is used which is on qwerty just one key above tab. For non-qwerty
layouts the shortcut is unfortunately not convenient.
REVIEW: 104730
FEATURE: 299308
FIXED-IN: 4.9.0
This makes kwin in OpenGL2 mode more coherent with kwin_gles.
Despite some fullscreen effects they should now make the same
(pure) OpenGL calls.
REVIEW: 103804