Commit Graph

74 Commits (7e8facc3fde853a93683554e5fc9bfd4985e4760)

Author SHA1 Message Date
Martin Gräßlin 88e56f630b Raise minimum required Mesa version to 10.0
Summary:
The currently minimum required Mesa version was 8.0 and KWin had special
caseing for Mesa 9.1. This is no longer realistic, no distribution
provides such an old Mesa version. So let's increase the version a
little bit.

Overview of Mesa versions supported by distributions:
 * Debian stable (stretch): 13.0
 * Debian oldstable (jessie): 10.3
 * Debian oldstable backports: 13.0
 * Debian oldoldstable (wheezy): 8.0
 * Ubuntu 16.04 LTS: 11.2
 * Ubuntu 16.04 LTS updates: 12.0
 * Ubuntu 17.04: 17.0
 * openSUSE Tumbleweed: 17.1
 * openSUSE Leap 42.2: 11.2
 * openSUSE Leap 42.3: 17.0
 * Arch: 17.1
 * Fedora 24: 12.0
 * Fedora 25: 17.0
 * Fedora 26: 17.1

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6462
2017-07-06 20:45:58 +02:00
Martin Gräßlin 2a41229e93 Disable lanczos filter with software emulation 2016-08-24 07:49:00 +02:00
Martin Gräßlin b366f0ac01 Use shader traits API for lanczos filter's shader 2016-01-25 14:11:54 +01:00
Martin Gräßlin 99739106d1 Use shader traits API to render cached texture in lanczos filter 2016-01-25 14:11:54 +01:00
Fredrik Höglund 4d738b86ea Add an internalFormat parameter to the GLTexture ctor
This parameter is ignored on GLES.
2014-12-30 21:19:49 +01:00
Daniel Pastushchak 0d997b1093 Introduce categorized logging for kwin core
Done by Daniel Pastushchak for KDE during GCI-2014.
2014-12-05 14:27:15 +01:00
Martin Gräßlin bf4ba54647 Remove displayWidth and displayHeight from the compositor
Instead of getting size from displayWidth() and displayHeight() use
the information we have from Screens. This means there is only one
place to have the information and by that we can ensure that all
components use the same data to rely on. displayWidth/displayHeight
seem to provide the wrong information when unplugging an output
without disabling the output. This results in rendering artefacts.
But KWin::Screens has the correct information available.
2014-11-27 09:00:19 +01:00
Fredrik Höglund edb0751cba Remove the NPOT texture support checks
We require OpenGL 2.0 which always supports NPOT textures.
2014-11-22 15:53:15 +01:00
Martin Gräßlin 979e5e9136 Do not check graphicsEffectsLevel for LanczosFilter
We use GPU and driver dependent checks which are more accurate than
the global setting has ever been.
2013-09-09 06:03:35 +02:00
Martin Gräßlin 57905c0cc2 And we got rid of KDebug
Usages of kBacktrace got dropped.
2013-09-02 13:14:39 +02:00
Martin Gräßlin 9291b18cee Merge branch 'master' into frameworks-scratch
Conflicts:
	CMakeLists.txt
	kwin/effects.cpp
	kwin/effects/logout/logout.cpp
	kwin/effects/presentwindows/main.qml
	kwin/effects/presentwindows/presentwindows.cpp
	kwin/effects/presentwindows/presentwindows.h
	kwin/effects/zoom/zoom_config.cpp
	kwin/libkwineffects/kwinglutils_funcs.cpp
	kwin/libkwineffects/kwinxrenderutils.cpp
	kwin/nvidiahack.cpp
	kwin/xcbutils.h
	plasma/desktop/containments/desktop/plasma-containment-desktop.desktop
	plasma/generic/wallpapers/image/image.cpp
	plasma/generic/wallpapers/image/plasma-wallpaper-image.desktop
2013-08-07 10:10:06 +02:00
Martin Gräßlin 330d40f425 Fix no cast to/from ASCII intrduced issues
* "" needs to be wrapped in QStringLiteral
* QString::fromUtf8 needed for const char* and QByteArray
* QByteArray::constData() needed to get to the const char*
2013-07-24 09:58:33 +02:00
Thomas Lübking 04aa9e9531 rather omit lanczos than capping windows
capping shadows is seen as bug (and is ugly and
because of the non lanczos transition causes visual
flicker) so if the window+shadows extends the buffer,
lanczos is simply not possible.

BUG: 314838
FIXED-IN: 4.11
REVIEW: 111425
2013-07-19 22:18:49 +02:00
Martin Gräßlin 4ab0a6a223 Disable lanczos filter also for SandyBridge on Mesa 9.1
Debian gave me an update to 9.1 and I started feeling the pain...
Mesa 9.2 works fine on the same hardware.

REVIEW: 111558
2013-07-18 16:02:38 +02:00
Martin Gräßlin 561a4f437a Enable Lanczos for IvyBridge and Mesa 9.2 again
Performance regression is fixed in Mesa 9.2. See Bug report
https://bugs.freedesktop.org/show_bug.cgi?id=61554

CCBUG: 313613
REVIEW: 110569
2013-05-22 08:20:49 +02:00
Fredrik Höglund 54b63a85a6 kwin: Add GLSL 1.40 versions of the scene shaders
Adjust ShaderManager to load the 1.40 versions when GLSL 1.40
is supported.
2013-05-08 18:33:03 +02:00
Fredrik Höglund 79db2fc98a kwin: Move the scene shaders into shaders/1.10 2013-05-08 18:33:03 +02:00
Martin Gräßlin 4a48325de5 Cleanup and reorder includes in client.h
Removing the workspace include required to include it in many other
places.
2013-04-29 08:42:36 +02:00
Martin Gräßlin 0cbc79193b Do not use stackingOrder in LanczosFilter to get all EffectWindows
LanczosFilter tries to discard all cached textures in the timer event by
getting the stacking order and iterating over it. But this approach seems
wrong from several aspects.

First of all the xStackingOrder does not include Deleted windows. So if
a cached texture still exists on an EffectWindow for a Deleted it would
not be discarded.

Also the xStackingOrder could result in an update from X because the
stacking order is currently considered dirty.

Last but not least the EffectsHandler::stackingOrder creates a temporary
list of EffectWindows - good for Effects but not necessarily useful
inside KWin core.

Instead the LanczosFilter gets the list of Clients, desktops, unmanaged
and deleted and iterates over them to check whether there is a texture to
discard.

REVIEW: 109954
2013-04-11 12:57:53 +02:00
Martin Gräßlin 504cb6fa4d Do not check compositing type in LanczosFilter
The LanczosFilter is only created by the SceneOpenGL2, so yes it is
OpenGL2 compositing - no need to check each frame.
2013-04-11 12:57:05 +02:00
Fredrik Höglund 010b3c94de Merge branch 'KDE/4.10'
Conflicts:
	kwin/lanczosfilter.cpp
2013-03-21 17:13:34 +01:00
Fredrik Höglund 2cec03dede kwin: Fix the blend function in the lanczos filter
The alpha values are pre-multiplied.
2013-03-21 16:31:06 +01:00
Martin Gräßlin 98a04893a6 Use mgraesslin@kde.org for my mail address in Copyright and AboutData 2013-03-12 13:17:53 +01:00
Martin Gräßlin c3ec860a72 Drop ARB shader code path from Lanczos Filter
Since color correction got pushed merged in the Lanczos Filter is only
created for OpenGL2. Which means the complete ARB shader code path has
been dead since 4.10 anyway.

REVIEW: 108856
2013-03-12 08:48:37 +01:00
Martin Gräßlin fa25f7a3bb Disable Lanczos for IvyBridge with Mesa 9.1
I don't like to do it, but it's better than users getting a bad
performance experience.

The change should be reverted once the issue is identified and fixed.

CCBUG: 313613
REVIEW: 109200
2013-02-28 16:03:53 +01:00
Casian Andrei 22569f7eb9 Remove forceAlpha uniform, which is no longer needed
This was originally added by d467fc1bdbcf69bd6ef213bd909633c2edfb6878,
to prevent alpha ending up to be 0 with blending disabled. Apparently,
that was a driver issue that is no longer present.

REVIEW: 107090
2012-11-13 22:23:18 +02:00
Martin Gräßlin 26a9a35b2f Increase runtime requirement to Mesa 8.0
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
2012-10-25 11:45:36 +02:00
Martin Gräßlin cf5de22586 Introduce a build option KWIN_BUILD_OPENGL_1_COMPOSITING
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.
2012-10-25 11:34:12 +02:00
Martin Gräßlin 2b6c4730b5 Re-enable Blur/Lanczos for Catalyst on OpenGL 2
Given that the Catalyst driver is now supporting direct rendering and by
that can use the OpenGL 2 code path we do no longer need to force
disable the Blur effect and Lanczos filters which used to crash in the
ARB shader path.

The ARB shader path - which can only be used in OpenGL 1 - is kept
disabled for Catalyst.

CCBUG: 270818
CCBUG: 286795
REVIEW: 106798
2012-10-25 11:30:18 +02:00
Jurica Vukadin bcdc74f8d6 Fix more C++11 narrowing warnings
REVIEW: 106997
2012-10-24 20:43:19 +02:00
Martin Gräßlin c2a4f81927 Introduce a helper class to automatically push/pop Shaders
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
2012-09-29 15:33:57 +02:00
Martin Gräßlin f9a2ecbf33 Do not use ShaderManager::isValid to check for OpenGL2 compositing
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.
2012-09-29 15:33:57 +02:00
Martin Gräßlin 6d2dfe06e7 Introduce dedicated OpenGL1 and OpenGL2 compositing types
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.
2012-09-29 15:33:57 +02:00
Martin Gräßlin c7262e8bd3 Getter/setters for opacity, saturation and brightness in WindowPaintData
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
2012-07-19 18:25:48 +02:00
Martin Gräßlin a2b0d42916 Replace translation by QVector3D in Screen/Window PaintData 2012-07-19 18:25:03 +02:00
Martin Gräßlin 0eff12eb92 Use QGraphicsScale for scale information in ScreenPaintData 2012-07-19 18:25:03 +02:00
Martin Gräßlin 1f52366fc1 Disable ARB Lanczos Shader for Intel GPUs
For Sandybridge Lanczos Shader is enabled, but only GLSL is working
so the ARB variant has to be disabled for Intel GPUs.

BUG: 301729
FIXED-IN: 4.9.0
REVIEW: 105233
2012-06-12 22:53:36 +02:00
Martin Gräßlin 71d703efe3 Fix uninitialized class members in LanczosFilter
SVN_SILENT
2012-05-27 16:35:04 +02:00
Martin Gräßlin d0d274b855 Don't compare uint with int
Explicitly cast uint to int to fix a warning.
2012-05-27 16:35:04 +02:00
Philipp Knechtges 8e8212b0ef kwin: adding a proper clipping to the lanczosfilter 2012-05-01 23:19:42 +02:00
Martin Gräßlin a5d620a6c2 Use KWin Options to read texture scale settings
No need to re-read the config.
REVIEW: 104298
2012-03-16 13:46:50 +01:00
Martin Gräßlin 139c5bf58b Allow Lanczos for SandyBridge 2012-02-04 11:25:15 +01:00
Martin Gräßlin 6e445fb75c Less unused parameter/variable warnings in kwin
SVN_SILENT
2011-12-31 15:08:54 +01:00
Martin Gräßlin f135206781 Disable Lanczos and Blur for fglrx
Too many crash reports in the fglrx driver when using ARB shaders.
It's a pity to disable functionality for all fglrx users, but it's
better than crash reports.

Blur effect can still be enabled manually and Lanczos can still be
enabled through the environment variable.

REVIEW: 103556
CCBUG: 270818
CCBUG: 286795
2011-12-31 08:54:15 +01:00
Philipp Knechtges ef9aeafe0d kwin: Optimizing Blur Part II
This patch adds an optional texture cache to the blur effect such that damaged windows in
front of the blurred region dont trigger a repaint of the whole blurred region which pretty
often results in a avalanche repaint of nearly the whole screen.

REVIEW: 101977
2011-09-18 02:01:31 +02:00
Martin Gräßlin 987bc837d9 Remove define KWIN_HAVE_OPENGL_COMPOSITING
Due to changes in build system we have always either OpenGL or OpenGL ES.
This allows to remove the KWIN_HAVE_OPENGL_COMPOSITING define. In the
effects the define is kept as KWIN_HAVE_OPENGL which can be used in
future to build also an XRender only effect system.
2011-08-13 16:46:43 +02:00
Martin Gräßlin 9c9ed80a2b Add environment variable to enforce Lanczos Filter
By setting KWIN_FORCE_LANCZOS=1 the settings and
driver check are overwritten.

This should help to test mesa bug 33275
(https://bugs.freedesktop.org/show_bug.cgi?id=33275)
2011-07-20 22:41:58 +02:00
Martin Gräßlin 728f333e6a Only use GLSL shader for lanczosfilter if ShaderManager is valid 2011-04-29 16:44:48 +02:00
Thomas Lübking fab764f6c6 only use lanczos filter when either direction is scaled below 90%
BUG: 263653
2011-04-25 21:42:29 +02:00
Martin Gräßlin 82b8f8d2fc Drop the driver blacklist
Let's face it: it was a bad idea and the blacklist never got updated.
2011-03-15 20:11:11 +01:00