Commit graph

175 commits

Author SHA1 Message Date
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
388944314a Drop QPixmap ctor of XRenderPicture
Was a todo to remove it as it's just using a toImage. Removing this
ctor should make it for the user more obvious that put image is used.
2013-08-13 09:57:50 +02:00
Thomas Lübking
ebfd3f58d8 implement crossfading on xrender
REVIEW: 111383
2013-08-06 23:06:39 +02:00
Thomas Lübking
bcf6c9c319 use configured xrender filter
that's why it's configured

REVIEW: 111428
BUG: 322074
FIXED-IN: 4.11
2013-07-08 18:53:36 +02:00
Martin Gräßlin
e7ab3adafd New class to encapsulate a Window's Pixmap
The behavior for creating a pixmap for a window is moved from Toplevel
into a dedicated class WindowPixmap. Scene::Window holds a reference to
this class and creates a new WindowPixmap whenever the pixmap needs to be
discarded. In addition it also keeps the old WindowPixmap around for the
case that creating the new pixmap fails. The compositor can in that case
use the previous pixmap which reduces possible flickering. Also this
referencing can be used to improve transition effects like the maximize
windows effect which would benefit from starting with the old pixmap.

For XRender and OpenGL a dedicated sub-class of the WindowPixmap is
created which provides the additional mapping to an XRender picture and
OpenGL texture respectively.

BUG: 319563
FIXED-IN: 4.11
REVIEW: 110577
2013-06-05 08:18:11 +02:00
Thomas Lübking
b7e6a334da rebase measuring to nano res + fix vsync padding
REVIEW: 109784
2013-05-20 16:09:27 +02:00
Martin Gräßlin
76d96506dc Remove damage argument in Toplevel::resetDamage
We always reset with the complete window geometry, so the subtracting
doesn't make any sense. We can just always set the damage to an empty
region.

REVIEW: 110438
2013-05-17 10:07:45 +02:00
Martin Gräßlin
2ab0de12e9 Remove dead code 2013-04-26 12:32:08 +02:00
Martin Gräßlin
466bef3a6d Adding a DesktopThumbnailItem declarative item
Similar to WindowThumbnailItem for rendering a desktop thumbnail.
Uses the new paintDesktop hook.

FEATURE: 296067
FIXED-IN: 4.11.0
REVIEW: 104441
2013-04-24 11:45:47 +02:00
Martin Gräßlin
265b5523e2 Move decoration related methods from Workspace to DecorationPlugin
They were all just delegating to the DecorationPlugin.
2013-04-15 09:59:09 +02:00
Martin Gräßlin
1bb5a81292 Port SceneXRender to XCB
SceneXRender no longer uses XRender from XLib, but only XCB.

REVIEW: 109190
2013-03-13 08:19:14 +01:00
Martin Gräßlin
4e598ed641 Port SceneXRender::EffectFrame to XCB render 2013-03-13 08:12:40 +01:00
Martin Gräßlin
4a69ffb5c0 Do not use QPixmap::x11PictureHandle() to render shadow elements
The QPixmap's are wrapped using XRenderPicture.
2013-03-13 08:12:40 +01:00
Martin Gräßlin
ce930dfc8a Use xRenderBlendPicture as alpha mask in SceneXrender
Less duplicated functionality.
2013-03-13 08:12:40 +01:00
Martin Gräßlin
fba7504063 Introduce dedicated PaintRedirector subclasses for OpenGL/XRender
PaintRedirector is turned into an abstract class providing a factory
method which returns either an instance of
* OpenGLPaintRedirector
* NativeXRenderPaintRedirector
* RasterXRenderPaintRedirector

OpenGLPaintRedirector is basically doing exactly the same as the parent
class used to do before. Though the idea is to extend the functionality
to have the PaintRedirector write directly into OpenGL textures to limit
copying the complete decorations.

NativeXRenderPaintRedirector is similar to OpenGLPaintRedirector by
rendering into a QPixmap and providing the pictureHandle for the QPixmap
to SceneXRender.

RasterXRenderPaintRedirector is providing the functionality for the case
that the QPixmap/XPixmap relationship is not present. From the QPixmap
containing the pending decoration paint a QImage is created and then the
relevent parts are copied directly into the decoration pixmap.

REVIEW: 109074
2013-03-11 11:19:57 +01:00
Martin Gräßlin
32b6ef42b9 Strip module path from all Qt #include <>
Done with:
fixqt4headers.pl --strip-modules

REVIEW: 109176
2013-03-06 10:26:56 +01:00
Martin Gräßlin
f45ade7785 Port preMultiply of color to xcb_render
Method returns a xcb_render_color_t instead of an XRenderColor.

With this change kwinxrenderutils is XLib free!
2013-02-14 14:20:27 +01:00
Martin Gräßlin
f20ec15053 Port xRenderOffscreenTarget away from QPixmap
Instead of having a pointer to a QPixmap the offscreen target holds an
xcb_render_picture_t. To make this possible in SceneWindow the tempPixmap
is changed from a QPixmap* to a XRenderPicture*. QPixmap was only used
for convenience.

ScreenShot Effect as only user of the offscreen target is adjusted but
as it needs a QImage, still uses a QPixmap wrapper.
2013-02-14 14:20:27 +01:00
Martin Gräßlin
a1ac6df20e Move XRender based rendering of unstyled EffectFrame into scene_xrender
This follows how it is done for OpenGL where the renderRoundBox() got
dropped some time ago.

New implementation implements the box with round corners using xrender
directly instead of using a QPainter on a QPixmap.
2013-02-14 14:20:26 +01:00
Martin Gräßlin
368de6842a Wrapper class to create an xcb_xfixes_region_t from a QRegion
Replaces the previously existing method to convert a QRegion which did
not take care of freeing the region again.

Usages are ported over.
2013-02-14 14:20:26 +01:00
Martin Gräßlin
b967527db3 Use XCB to resolve the X11 Extensions
The extension handling is removed from kwinglobals and moved into the
xcbutils in KWin core in namespace KWin::Xcb. The motivation for this
change is that the Extensions are only used in KWin core and are marked
as internal. So there is no need to have them in the library.

What remains in Extensions are the non-native pixmaps. This will be
removed once we are on Qt 5 as QPixmap can no longer reference an XPixmap.

The remaining code in kwinglobals also still initialize the XLib versions
of extensions emitting events. It seems like there are no XEvents emitted
if not done so even if the extension is correctly initialized with xcb.
This needs to be removed once the event handling is ported over to xcb.

REVIEW: 107832
2013-01-22 07:50:03 +01:00
Thomas Lübking
7ca47bdd36 support brightness > 1 for XRender backend
REVIEW: 107854
2013-01-02 18:43:14 +01:00
Martin Gräßlin
67174bbf69 Remove outdated and not very useful comment sections
If a section of comments consists of a list of links and all are broken
it's a sign that nobody has used these comments for a long time...

REVIEW: 107933
2012-12-30 09:52:42 +01:00
Martin Gräßlin
a5213c454b Warnings--
SVN_SILENT
2012-12-27 09:05:13 +01:00
Thomas Lübking
5faa328f04 clip boundingshaped regions in xrender backend
BUG: 311216
FIXED-IN: 4.10
2012-12-14 22:36:39 +01:00
Fredrik Höglund
e578676f42 kwin: Rename flushBuffer() to present()
This function doesn't flush any buffered commands, it presents or posts
the color buffer to the surface to which the GL context is bound.
2012-10-29 21:31:17 +01:00
Jurica Vukadin
bcdc74f8d6 Fix more C++11 narrowing warnings
REVIEW: 106997
2012-10-24 20:43:19 +02:00
Martin Gräßlin
0d81d1d7c0 Move decoration pixmap handling from Client to PaintRedirector
The only task of the PaintRedirector is to redirect the painting of the
window decorations into Pixmaps. So it should actually do this by also
handling the four pixmaps for the decoration. This simplifies the code
as all the logic concerning redirecting the painting is now grouped
together.

Furthermore the PaintRedirector is now a child of the decoration widget,
which means it gets automatically destroyed whenever the decoration is
destroyed - the Client does not have to care about it.

Also the PaintRedirector gets only created if the Compositor is active as
it is not needed in the non-compositing case.

REVIEW: 106620
2012-10-12 07:45:31 +02:00
Martin Gräßlin
6152cc4fa5 Split out the windowing system related part of SceneOpenGL
The handling for creating and managing the OpenGL context is
split out of the SceneOpenGL into the abstract OpenGLBackend
and it's two subclasses GlxBackend and EglOnXBackend.

The backends take care of creating the OpenGL context on the
windowing system, e.g. on glx an OpenGL context on the overlay
window is created and in the egl case an EGL context is created.
This means that the SceneOpenGL itself does not have to care
about the specific underlying infrastructure.

Furthermore the backend provides the Textures for the specific
texture from pixmap operations. For that in each of the backend
files an additional subclass of the TexturePrivate is defined.
These subclasses hold the EglImage and GLXPixmap respectively.

The backend is able to create such a private texture and for
that the ctor of the Texture is changed to take the backend as
a parameter and the Scene provides a factory method for
creating Textures. To make this work inside Window the Textures
are now hold as pointers which seems a better choice anyway as
to the member functions pointers are passed.
2012-09-16 21:28:05 +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
Thomas Lübking
fc665106c9 Swap vsync order, trade in 1frame lag
REVIEW: 103058
2012-05-17 11:41:26 +02:00
Thomas Lübking
88aeec920e re-add SceneXRender::paintGenericScreen implementation to cache screen_paint data 2012-03-21 00:37:10 +01:00
Thomas Lübking
1070bf895b split decorationRect / visibleRect usage
REVIEW: 104215

cherry-picked from 0f3380f3b10e57416f81a1288dc10b8dfe11d87e
Conflicts:

	kwin/geometry.cpp
	kwin/scene.cpp
2012-03-21 00:36:50 +01:00
Thomas Lübking
5e2414544f add offscreen render support to xrender
REVIEW: 104151
cherry-picked from b9534b4ca82973c2e99451b2e151241fd1b6e7cb
2012-03-21 00:35:31 +01:00
Thomas Lübking
357b6b5338 resolve merge conflict 2012-03-07 22:02:26 +01:00
Thomas Lübking
3e4cb7539e fix shading for xrender compositing
REVIEW: 104150
2012-03-07 20:53:38 +01:00
Martin Gräßlin
212908ee88 Refactoring of KWin::Options: getter methods instead of public variables 2012-02-27 19:31:58 +01:00
Philipp Knechtges
9f9bde77ad kwin: removing SceneXrender::paintTransformedScreen
It is an unused function which becomes more and more obsolete with a
better support of transformed windows in paintSimpleScreen.
2012-02-09 14:52:46 +01:00
Philipp Knechtges
55a75da893 kwin: fixing xrender shadow bug
This fixes a xrender shadow bug, which was introduced in commmit
7a8398f80ec0aa67ed1102cded2bbb45d7736ecb.

Many thx to Jacopo De Simoi.
2012-02-07 10:46:17 +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
050d991cb1 kwin: simplifying paintSimpleScreen
This patch reduces the number of QRegion and WindowQuadList operations
by drawing the opaque and translucent parts of the window within the
same bottom to top pass.

REVIEW: 103671
2012-01-11 18:04:28 +01:00
Martin Gräßlin
6e445fb75c Less unused parameter/variable warnings in kwin
SVN_SILENT
2011-12-31 15:08:54 +01:00
Thomas Lübking
393b8a3eee scene_xrender.cpp, replace QRect = QRect by QRect::setRect 2011-12-18 19:51:52 +01:00
Thomas Lübking
634a504ce1 straighten xrender shadow implementation
did not publish function & enum in the baseclass, but inlined the accessor

REVIEW: 103232
(cherry picked from commit ecfa39ac3ca1c9823a6b320ff0f7a60ab32f0418)
2011-11-27 15:03:41 +01:00
Thomas Lübking
19bb897c5b fix opacity bug in scene_xrender
resort xrender painting - paints deco after client to avoid pot. opacity mask recalculation
2011-11-24 20:17:19 +01:00
Fredrik Höglund
eb9988b788 kwin: Make Scene::m_renderTimer a non-member
It's only used in Scene::paint(), and its value is not valid
between calls.
2011-10-29 17:41:16 +02:00
Thomas Lübking
8f81339bca fix xrender scale+shadowed toplevel geometry
(cherry picked from commit 01ea7ad7f2a97924f4b6ee41adde01eef27b6e8b)

REVIEW: 102703
FIXED-IN: 4.7.3
2011-10-10 20:49:01 +02:00
Martin Gräßlin
6e15c0c208 Change timers to QElapsedTimers
Instead of calculating the elapsed time from epoch clock, using
a QElapsedTimer as well as reusing the timer object instead of
creating a new one in the scene each frame.

REVIEW: 102473
2011-08-29 06:48:44 +02:00