Commit Graph

41 Commits (976037717b9a2552b80f134e9b8c95be62238529)

Author SHA1 Message Date
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
Martin Gräßlin e5e5c4a020 Move push/popRenderTarget to kwingluitls
(De)Activating a FBO is OpenGL specific and does not belong into EffectsHandler.
2011-03-13 14:34:30 +01:00
Martin Gräßlin 0827c2903b Use GLPlatform to decide whether shaders are supported
Dropping the static methods from GLShader and use supports()
where it was used before.
2011-02-19 11:08:43 +01:00
Fredrik Höglund 73be6657ea kwin: Replace brightness and opacity with a modulation constant
This makes it possible to adjust both brightness and opacity
at the same time with one multiplication in the fragment shader.
2011-02-12 01:45:38 +01:00
Fredrik Höglund 2fa966e0f9 kwin: Use the new setUniform() overloads in kwin core 2011-02-10 19:37:51 +01:00
Martin Gräßlin 0a7e48f7aa KWin uses kdelibs coding style. 2011-01-31 20:07:03 +01:00
Fredrik Höglund 1a5b3b4bea Disable and delete the fragment program if it fails to compile.
svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1215777
2011-01-30 15:25:01 +01:00
Fredrik Höglund bfa2fc68e6 Rewrite the ARB lanczos shader to work with the Radeon R300 limitations.
svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1215505
2011-01-30 15:11:22 +01:00
Fredrik Höglund 1a93cc40d2 Disable the lanczos filter with the Intel driver in Mesa 7.10.
It's reported to cause kwin to hang when rendering thumbnails.

svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1215502
2011-01-30 15:07:41 +01:00
Martin Gräßlin a6de13e2f7 Use ShaderManager to bind the shader in Lanczos. 2011-01-30 14:12:06 +01:00
Martin Gräßlin 78c4c7a86e Lanczos filter available in GLES.
It uses a default vertex shader, so the existing shader can be dropped.
2011-01-30 14:12:04 +01:00
Martin Gräßlin c6dd3690f5 Don't clip when rendering to FBO. 2011-01-30 14:12:04 +01:00
Martin Gräßlin 14522ebecb Fix Linker error with Lanczos filter 2011-01-30 14:11:56 +01:00
Martin Gräßlin b145ad6065 Lanczos not available in ES 2011-01-30 14:11:56 +01:00
Thomas Lübking 4cf251436f exclude non opaque (NOT "non ARGB") windows from lanczos filter unless we've a working blendfunction for the cached texture
BUG: 258439

svn path=/trunk/KDE/kdebase/workspace/; revision=1207826
2010-12-19 21:32:02 +00:00
Thomas Lübking 029f93127f kick trilinear filtering if favor of the lanczos filter (now default, unless blacklisted)
make the scale method configurable and align the UI for GL and Xrender

CCBUG: 243181


svn path=/trunk/KDE/kdebase/workspace/; revision=1195698
2010-11-11 19:53:19 +00:00
Martin Gräßlin 6270b502ba ARB Shader fallback to Lanczos filter.
This allows using Lanczos filter also on systems not supporting GLSL.
See http://svn.reviewboard.kde.org/r/5777/

svn path=/trunk/KDE/kdebase/workspace/; revision=1195273
2010-11-10 18:25:40 +00:00
Thomas Lübking 4db74f544d workaround nvidia issues with the texture cache and translucent windows
svn path=/trunk/KDE/kdebase/workspace/; revision=1195268
2010-11-10 18:08:46 +00:00
Martin Gräßlin 3e689ff201 Cache generated Lanczos textures.
This provides a significant performance improvement especially for Present Windows.
Whenever a lanczos resampling is done the resulted texture is cached, till the
window is damaged or a texture of different size is required. This means that
for a taskbar thumbnail the resampling only occurs once unless the window is damaged
and for present windows it only occurs when the windows are resized and then only
after the windows have already been moved. Highlighting windows does not cause
a resampling any more.
See review request http://svn.reviewboard.kde.org/r/5708/

svn path=/trunk/KDE/kdebase/workspace/; revision=1191874
2010-11-01 10:46:11 +00:00
Fredrik Höglund 119c06e403 Make the lanczos shader use a fixed number of iterations in the loop.
This makes it possible for the GLSL compiler to unroll it, which also
avoids the need to use relative addressing. With this change the shader
should hopefully work with the R300G driver.

The unused kernel weights are set to zero so they don't contribute
to the end result.

Thanks to Tom Stellard and Marek Olšák for their suggestions on how
to solve this problem.

CCBUG: 243191

svn path=/trunk/KDE/kdebase/workspace/; revision=1175021
2010-09-13 22:03:21 +00:00
Martin Gräßlin a16f7f0672 Only use lanczos if the window size does not exceed the FBO size.
svn path=/trunk/KDE/kdebase/workspace/; revision=1169481
2010-08-29 11:27:57 +00:00
Martin Gräßlin f359d19a90 Don't crop away the decoration shadows in the lanczos filter.
svn path=/trunk/KDE/kdebase/workspace/; revision=1160557
2010-08-08 09:59:03 +00:00
Martin Gräßlin 4111a9f051 Support for adding a driver blacklist to be used in the lanczos filter and blur effect.
It uses a new config group Blacklist in kwinrc with two subgroups for Lanczos and Blur.
The key of each entry in the group referrences the vendor either using GL_VENDOR or GL_RENDERER, e.g. "Intel" in renderer for Intel based chips.
The value of the entries is a stringlist containing exactly the renderer information. This way it is possible to blacklist several mesa driver versions which are buggy.
The blacklist is currently empty and will be filled with a kconf update script (which could also be done by distributions). So all users who experience problems and are subscribed to the bugs receiving this message, please upload your glxinfo.
An example for a blacklist:
[Blacklist][Lanczos]
NVIDIA=GeForce 9400M/PCI/SSE2

CCBUG: 243181
CCBUG: 242985

svn path=/trunk/KDE/kdebase/workspace/; revision=1146195
2010-07-05 13:42:34 +00:00
Martin Gräßlin c705dd474e add missing ifdefs to make the code compile if OpenGL is not present
svn path=/trunk/KDE/kdebase/workspace/; revision=1137402
2010-06-12 16:43:25 +00:00
Martin Gräßlin 191435d425 Move Lanczos filter from taskbarthumbnail effect into the scene and use it also in boxswitch, presentwindows and thumbnailaside effects.
svn path=/trunk/KDE/kdebase/workspace/; revision=1133901
2010-06-02 20:04:54 +00:00