Commit Graph

80 Commits (c679ec650875646b927d2ec94513349c6a9fd3f0)

Author SHA1 Message Date
Martin Gräßlin 99db844912 Bind ARBBlurShader to OpenGL1
The logic has already ensured that the ARBBlurShader can only be used
when using the OpenGL1 compositor, the OpenGL 2 compositor needs to use
the GLSLBlurShader.

This change moves the complete ARBBlurShader into a KWIN_HAVE_OPENGL_1
ifdef section.

As a side-effect the ::create method can now return a NULL pointer which
makes more sense then returning an ARBBlurShader in case that the
GLSLShader is not supported.

REVIEW: 106738
2012-10-25 11:34:30 +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
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
Lilian A. Moraru 99fcab5c36 Use KConfigXT in Blur effect
REVIEW: 106400
2012-09-15 11:24:11 +02:00
Martin Gräßlin 90365e27d0 Merge branch 'KDE/4.9'
Conflicts:
	khotkeys/data/kde32b1.khotkeys
	kinfocenter/Modules/opengl/opengl.desktop
	kwin/tabbox/tests/CMakeLists.txt
	plasma/generic/applets/system-monitor/plasma-applet-sm_hdd_activity.desktop
2012-08-17 17:59:49 +02:00
Martin Gräßlin 23f2de009b Effects can provide support information through properties
The supportInformation is extended to also read the properties
on all effects. In addition each effect can be queried just for
itself through D-Bus, e.g.:
qdbus org.kde.kwin /KWin supportInformationForEffect kwin4_effect_blur

All effects are extended to provide their configured and read
settings through properties. In some cases also important
runtime information is exposed.

REVIEW: 105977
BUG: 305338
FIXED-IN: 4.9.1
2012-08-17 17:49:49 +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 f723f132ca Drop support for explicit contents opacity from WindowPaintData
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.
2012-07-19 18:25:03 +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
Philipp Knechtges 93b2674313 kwin: dropping several gl(Push|Pop)(Attrib|Matrix) calls
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
2012-04-19 21:01:46 +02:00
Martin Gräßlin 2007a7eab8 Use namespaced parameters in signals
Required to get scripting bindings working.
2012-03-12 21:37:40 +01:00
Philipp Knechtges 999d64bb19 kwin/blur: consider the valid part of the cache as being opaque
This reduces the repaints in cases where several blur regions are
stacked on top of each other (e.g. oxygen-transparent) and the topmost
layer needs to be updated (e.g. a blurry window is moved).
2012-02-19 01:28:23 +01:00
Philipp Knechtges f3117f1038 kwin/blur: substituting QHash::operator[] by an iterator-based approach 2012-02-19 01:28:16 +01:00
Philipp Knechtges 2bfcfeceb4 kwin: fixing blur bug for move/resize events
The old blur version wrongly marked a cache region as valid with the
reason that this region would never become visible. It didnt matter
because the only case that this region could become visible was a
movement of the window on top, which back then would have forced a
workspace repaint of that region and as such would have invalidated
the cache anyway. With the introduction of addLayerRepaint the
last point is no longer true and we have to track the valid cache
regions more carefully.
2012-02-16 22:13:08 +01:00
Philipp Knechtges 239d5757f2 kwin: move/resize events shall not force a repaint of all layers
This patch adds a new function Toplevel::addLayerRepaint, that in contrast
to addWorkspaceRepaint does not invalidate every blur texture cache that
overlaps with that region. As the name suggests it rather invalidates the
to the window associated layer at that position. This is especially useful
in the case of move/resize events in combination with oxygen-transparent,
where the altered window is almost always the topmost window and the blur
texture cache of the windows underneath are unchanged.

For the case of fully opaque windows the behaviour of addLayerRepaint
and addWorkspaceRepaint should be same.

REVIEW: 103906
2012-02-12 16:57:12 +01:00
Martin Gräßlin 05cd97c746 Enable Blur by default for SandyBridge
REVIEW: 103852
2012-02-04 11:25:16 +01:00
Thomas Lübking d845b60c6c change geometry w/o compositor restart
This possibly fails on some (older?) ati chip/driver combos
-> Waiting for bugreports

REVIEW: 103246
2012-01-24 22:27:15 +01:00
Philipp Knechtges c8fbb4ec61 kwin/blur: use already existing texture instead of allocating a new one 2012-01-08 17:23:36 +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
Martin Gräßlin 544c4d60b5 Blur behind sliding popups
Finally it is possible :-) If it causes an impact on performance
during the release candidates I'm going to revert.
REVIEW: 103375
BUG: 255106
FIXED-IN: 4.8.0
2011-12-10 22:41:35 +01:00
Philipp Knechtges 3065e6afce kwin/blur: add a proper initialization of the texture cache
This fixes graphical glitches that appear next to the borders of plasma
tooltips. Additionally I added a variable that forces the effect to
drop the cache, which might be useful in the future to fix bugs.
2011-12-10 17:35:02 +01:00
Philipp Knechtges 1023d3b08e kwin: fixing some blur bugs
This should fix 2 issues with the blur effect:
- It is now sufficient to have a damaged EXPANDED blurArea to trigger
  an update of the caching texture.
- No glitches in cases where the taskbarthumbnail effect paints a
  thumbnail of a blurred window.

CCBUG: 288568
2011-12-10 12:39:51 +01:00
Philipp Knechtges 1ea54ef44f kwin: fixing blur for shaded windows
If a window is "rolled" up we should not blur the specific regions.

CCBUG: 245388
2011-10-15 16:32:13 +02:00
Martin Gräßlin 15fc864c95 Drop GLES specific hack in blur effect
With GLES full repaints are no longer required. At least I can no
longer notice any visual issues.
2011-10-15 10:55:27 +02:00
Philipp Knechtges 5c7f919bbf kwin: updating comments on the blur texture cache 2011-10-12 16:02:19 +02:00
Philipp Knechtges b6c27a17b0 kwin: bugfix blur effect
This commit fixes the bug, that the blur texture cache is not marked invalid
when the related XProperty changes.

BUG: 283818
2011-10-12 15:16:46 +02:00
Philipp Knechtges b6478e1b12 kwin: Optimizing Blur Part III
This patch introduces some kind of damage propagation. In the old version of the blur effect
we had to repaint the whole window if sth behind the blurred area was damaged. The new texture
cache, which was introduced by the last patch, gives us the opportunity to only update parts of
blurred background texture. This means that the damaged area can only propagate with the speed
of the blurring radius per window layer.

REVIEW: 102665
2011-10-02 14:47:03 +02: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 fcbd22ad36 Workaround repaint issue in blur effect with GLES
This is actually a bloody hack by forcing the screen to be
repainted in each frame. This needs to be fixed in a different
way or we at least have to turn blur off by default for GLES in
the next release.
2011-09-17 20:01:59 +02:00
Martin Gräßlin 31386d2f25 Drop unused variables
SVN_SILENT
2011-08-31 17:55:04 +02:00
Martin Gräßlin f72f465c13 Fix Typos
Krazy--
SVN_SILENT
2011-08-03 08:25:10 +02:00
Philipp Knechtges afe8048afd kwin: optimizing the blur effect
This patch adds the capability to draw blurred region top to bottom using
paintSimpleScreen.

REVIEW: 101898
2011-07-14 14:20:56 +02:00
Fredrik Höglund 93dc4d459c kwin/blur: Don't blur anything when we're painting top-to-bottom 2011-05-14 18:26:21 +02:00
Fredrik Höglund b1990eec75 kwin/blur: Refactor the tests in drawWindow()
Move the tests into a separate function to improve readability.
2011-05-14 18:22:38 +02:00
Fredrik Höglund ff889337e2 kwin/blur: Use pos() instead of geometry().topLeft() 2011-05-08 12:05:22 +02:00
Fredrik Höglund 9a08f99958 kwin/blur: Fix a regression from a6bdff71
Subtract the screen-relative contents rect of the window from
the paint region, not the window relative rect.
2011-05-08 11:58:33 +02:00
Fredrik Höglund 65025071fc kwin/blur: Optimize the paint region
Optimize the region of the screen that's painted in each frame,
and paint the windows top-to-bottom when the damaged region doesn't
intersect any blurred areas.
2011-05-02 02:06:18 +02:00
Fredrik Höglund 7ef8f444f6 kwin/blur: Disable by default on all Intel chipsets 2011-05-02 02:06:17 +02:00
Martin Gräßlin d647950ff0 Do not blur behind EffectFrames with no style 2011-04-27 14:52:04 +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 640fdc7b6d PropertyNotify becomes a signal 2011-03-12 19:18:19 +01:00
Martin Gräßlin ab6f2ba1fd EffectsHandler emits windowAdded signal
All previously existing windowAdded methods are renamed to slotWindowAdded.
EffectsHandlerImpl is connected to Workspace's clientAdded signal, which is
emitted a little bit earlier than the previous direct method call. This might
change behavior.
Another signal is added to Workspace to signal that an unmanaged is added.
2011-02-25 22:06:02 +01:00
Martin Gräßlin b265537962 Drop dependency to libplasma from kwineffects library
Since the EffectFrames have been moved into KWin core nothing in the
Effects lib actually used Plasma. The only remaining method is moved
to core as it's not used in the Effects. The Effects itself still
link against Plasma, so nothing changes for them.

The Plasma includes in the kwineffects header seemed to pull in
quite some additional headers, so the includes in some effects have
to be adjusted (most often KConfigGroup). This should speed up the
compilation of the library and the effects.
2011-02-17 19:38:42 +01:00
Martin Gräßlin 0a7e48f7aa KWin uses kdelibs coding style. 2011-01-31 20:07:03 +01:00
Martin Gräßlin 3e42ddc2cc ShaderManager handles rebind of previous shader.
No need to explicitly rebind the window shader in blur effect.
2011-01-30 14:12:06 +01:00
Martin Gräßlin 8c4fc28e1a Blur ported to GLES.
It now uses a GLShader for GLSL shaders and pushes it using the
ShaderManager.

It does not work with the nouveau driver plus GLES, but it works
with fglrx + desktop GL 2.x, so I assume it is a driver problem here.
2011-01-30 14:12:06 +01:00
Martin Gräßlin 6353d6ff57 Don't blur behind opaque window decorations.
Adding a new AbilityUsesBlurBehind which can be set by decorations with
alpha channel to request that the background can be blurred. This improves
the situation for our completely opaque default Oxygen decoration.

This change is a behavior change in comparison to 4.5! Translucent decorations do
not get blurred by default any more.
CCMAIL: craig.p.drummond@googlemail.com

svn path=/trunk/KDE/kdebase/workspace/; revision=1195274
2010-11-10 18:33:07 +00:00