Commit graph

22 commits

Author SHA1 Message Date
Martin Gräßlin
1a0e586b9c Pass creation of Shadow sub class instance to Scene
Instead of having the Shadow factory method check the compositor type and
do the decision which Shadow sub class to create, a pure virtual method in
Scene is called which returns the specific Shadow sub class instance.
2014-01-07 15:34:19 +01:00
Martin Gräßlin
634a84e5c0 Port reading the shadow property to XCB 2013-09-11 08:21:44 +02:00
Martin Gräßlin
bd7da7ccd0 Bring back shadows
Main problem here was that it still used fromX11Pixmap. It's changed to
XCB and gets the image data with xcb_get_image, constructs a QImage from
retrieved data and copies it to QPixmap. That's performing a deep copy
which we want (and also had in the old code).
2013-07-31 15:25:39 +02:00
Martin Gräßlin
f210d42d14 Disable Shadow System for porting
Shadow system needs to change to not pass XPixmap handles around. That
was handy in Qt 4 but is difficult in both Widget Style and KWin in Qt5.
2013-07-24 09:47:03 +02:00
Thomas Lübking
6146fa39a4 rebuild quads when removing shadows for empty prop
BUG: 320786
FIXED-IN: 4.11
REVIEW: 110871
2013-06-10 16:34:18 +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
Thomas Lübking
7b3c58280b Support withdrawal of shadows
The Oxygen deco uses this to remove built-in shadows from decorated windows when adding (legacy...) decoration shadows

CCBUG: 291774
REVIEW: 103751
(cherry picked from commit a97bdc64fa2a676f99738abd371a99126fb8e93d)
2012-01-25 00:21:07 +01:00
Thomas Lübking
065666e35b simplify general shadow building code
REVIEW: 103236
(cherry picked from commit 4089e5a1842906bb388d18ccb6a7b0437b8699e2)
2011-11-27 15:04:02 +01:00
Thomas Lübking
f3d1261680 fix shadow quad update, allows to change shadow size with property update
(been OpenGL issue only)
fix TopLevel::visibleRect, broke shaded windows with empty (too big) shadows

REVIEW: 103231
(cherry picked from commit 535d40e7b4ca5a4431446c3d5c70e6d52f541fae)
2011-11-27 15:03:18 +01: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
b837a3fca1 Render Shadow with only one GL texture
Copies the shadow parts into one image and creates a GLTexture
from the image, so that we can render the complete shadow with
just one texture and one painting pass.

Should remove most of the overhead involved when rendering the new Shadows.

As a side effect this should fix missing shadows with non-NPOT GPUs and
a rendering glitch reported with NVIDIA.

REVIEW: 101742
2011-07-03 09:24:28 +02:00
Martin Gräßlin
04020f0b42 Deep copy of Shadow pixmap again
Basically revert of fb9afb61f8c1e7db4ae034435a9d54b5e87977d5.
Fixes an issue of black shadows which could sometimes happen in
OpenGL backend.
2011-06-19 20:54:14 +02:00
Martin Gräßlin
3775616a13 Do not deep copy the shadow pixmaps
The deep copy does not work with raster as it creates a non-native
pixmap. In fact the deep copy is not needed any more as it was a
safety check during development when apps using raster could crash
kwin.
2011-05-14 21:04:28 +02:00
Martin Gräßlin
911b037fe8 Add another pixmap safety check in Shadow creation
Do not only check for null pixmaps but also that the
pixmap contains a 32 bit depth as we don't want shadows
without alpha.
2011-05-14 21:02:11 +02:00
Jacopo De Simoi
e688058235 kwin: Implement shadows in XRender compositor
There are still some glitches to be fixed, but
it works well for most use-cases.
2011-04-28 11:39:48 -04:00
Martin Gräßlin
a9ce4aa2af Don't render a Shadow if the Shadow overlaps the window 2011-04-03 13:05:35 +02:00
Martin Gräßlin
7287019050 Update cached Shadow information on size changes
In order to notice when the geometry changes a new signal is
added to toplevel and both Unmanaged and Client connect all their
signals which are emitted whenever the geometry changes in some way
to this new signal.

Shadow connects to the signal and updates the quads and region
whenever the size changes.
2011-04-03 12:43:57 +02:00
Martin Gräßlin
38e9ab9a4e Move ownership on Shadow from Toplevel to Scene::Window
The Shadow is clearly an aspect of the compositor. Therefore the
Shadow has to be owned and controlled by the Scene::Window.
Nevertheless Toplevel needs to know about the Shadow cause of reading
the property.
2011-04-03 11:31:33 +02:00
Martin Gräßlin
c82fed057f Verify that Shadow pixmaps are valid
At least in rekonq the shadow pixmaps are not valid causing
an exception to be thrown and crashing kwin.
2011-04-02 19:03:08 +02:00
Martin Gräßlin
89aa8ee8db Fix repainting of shadow after window closes
Unmanaged needs to repaint the complete geometry including shadow
when it ends compositing. Therefore we need to track the shadow
passing to deleted correctly. Disadvantage: when turning off
compositing the shadow is kept. Need to solve in a better way!
2011-04-01 21:49:44 +02:00
Martin Gräßlin
bd12134f05 Deep copy the shadow pixmaps
At least with NVIDIA drivers we get bad alloc errors in glXCreatePixmap
for the shared pixmaps.
2011-03-30 20:33:08 +02:00
Martin Gräßlin
12220a0d59 Initial implementation of new Shadows in KWin
For a complete documentation of new functionality refer to:
http://community.kde.org/KWin/Shadow

The current implementation includes a new Shadow class and Toplevel
holds a pointer to an instance of this class. The Shadow class reads
the data from the X11 Property. There is one extended class located
in SceneOpenGL to render the shadow.

Compositor is adjusted to include the shadow region into the painting
passes.

Implementation for XRender still missing and Shadow needs to respond
to size changes of the Toplevel to update cached shadow region and
WindowQuads.
2011-03-27 12:33:07 +02:00