Commit Graph

372 Commits (e62001758f254104129ea55d29367ee17fb82ec8)

Author SHA1 Message Date
Martin Gräßlin 37334f400a Drop no longer needed XLib includes from KWin 2013-08-20 10:29:20 +02:00
Martin Gräßlin 84a2f3020b Use Qt5:: in target link libraries in KWin 2013-08-20 09:14:24 +02:00
Anselmo L. S. Melo 49c04f13b1 Porting libkwineffects to Qt5/KF5: QStandardPaths
REVIEW: 111976
2013-08-13 17:55:57 -03: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
Sebastian Kügler 08a53e6a11 Remove K_EXPORT_PLUGIN macros
Include .moc file in configs_builtins.cpp, and reenable the build of the
configs.

REVIEW:111940
2013-08-08 13:47:25 +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
Thomas Lübking b92ebe02aa add synthetic repaint after crossfade finished
prevents glitches after crossfading translucent window

REVIEW: 111888
2013-08-06 09:12:05 +02:00
Thomas Lübking e9e73f1134 add XRenderPicture(QImage) constructor
was implicitly present for QPixmap::toImage

REVIEW: 111878
2013-08-05 20:43:28 +02:00
Martin Gräßlin 469828c847 Cache display and rootWindow
No need to go through the QPA interface each time we access the
Display variable or need the root window.
2013-08-02 08:31:53 +02:00
Martin Gräßlin 1807265813 KDebug moved to KDE4Support
Adjust target link libraries.
2013-07-31 14:07:58 +02:00
Casian Andrei 4d24fe8b30 Fix many color correction problems with OpenGL ES
On GLES, check for OES_texture_3D extension for color correction

Remove a block of ugly hack code that was supposedly needed to build
with OpenGL ES.

Convert the lookup texture data to uint8 on OpenGL ES before sending it
via glTexImage3D, because uint16 is not supported.

Check if the shaders have been reinitialized successfuly when trying to
activate color correction, prevent black screens when there are issues
with the shaders.

BUG: 315419
REVIEW: 111225
(cherry picked from commit 68c68ee3c2b54f968c4d8275f1e8a2e0ccc90dd7)
2013-07-28 17:44:06 +03:00
Martin Gräßlin 9ab751042a Drop X11_XCB library dependency
We don't need it anymore - the xcb connection is also provided by
QX11Info.
2013-07-24 09:58:43 +02:00
Martin Gräßlin 202bc2fbf9 Fix include path to QX11Info 2013-07-24 09:58:43 +02:00
Martin Gräßlin f04b39c548 Adjust target link libraries 2013-07-24 09:58:42 +02:00
Martin Gräßlin e32635fb2e QMatrix4x4 does no longer wrap qreal 2013-07-24 09:58:41 +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
Martin Gräßlin 8dd61fdc53 Introduce a define to mark code areas which need porting 2013-07-24 09:47:02 +02:00
Martin Gräßlin 1d2c2d5982 Use Q_SLOTS and Q_SIGNALS instead of slots and signals
Fixes compilation with Qt5/KF5 setup.
2013-07-24 09:46:54 +02:00
Martin Gräßlin 2f9ff5591c Drop support for native graphics system
Qt 5 only supports raster which means our pixmaps are always non native,
so we don't need the Extension information any more and can drop all
special code handling for mapping a native QPixmap to an X11 pixmap.
2013-07-24 09:46:54 +02:00
Fredrik Höglund 4b120288b6 kwin: Use glBufferSubData() when preferred
Use glBufferData() to reallocate the data store, and glBufferSubData()
to upload data to unused ranges of vertex buffers.
2013-07-08 01:23:38 +02:00
Fredrik Höglund 9de4c490ba kwin: Add GLPlatform::preferBufferSubData()
This method returns true when glMapBufferRange() is likely to perform
worse than glBufferSubData() when updating an unused range in a buffer
object.

This is the case with the NVIDIA driver, where glMapBufferRange()
will force thread serialization. The driver tracks which ranges of
the buffer are in use, so calls to glBufferSubData() should not
cause a pipeline stall.
2013-07-08 01:23:37 +02:00
Fredrik Höglund 6562fcc665 kwin: Don't query GL_VIEWPORT in pushRenderTarget()
Assume that the default framebuffer has the same dimensions as the screen.

By not quering the dimensions of the viewport we don't risk serialization
in drivers that use threaded dispatch.
2013-06-27 00:06:54 +02:00
Fredrik Höglund 7124f5190b Revert "kwin: Make WindowQuadList inherit from QVector"
This reverts commit 23dff966437bb664a2ffdb3f7957ef39978f5fad.

Using QVector is not a win when effects such as wobbly windows are
active, due to the realloc overhead. So revert this change for now.
2013-06-27 00:06:49 +02:00
Martin Gräßlin db2e6687e1 Remove dead assignment in GLVertexBuffer::draw
Variable primitiveMode is not read in the branch and there's a return in
the same branch.

REVIEW: 111192
2013-06-26 17:58:48 +02:00
Thomas Lübking e717c131bf Hook modalChanged signal for DialogParent script
Eg. gtk+ alters the modality after mapping and
before unmapping the window.
Therfore the former implementation ahd a wrong idea
about the modality until the window was activated and
again had a wrong idea when the dialog closed, keeping
the main client dimmed.

Modality changes at runtime are uncommon but legal and can
happen anytime.

BUG: 321340
FIXED-IN: 4.11
REVIEW: 111154
2013-06-26 12:42:09 +02:00
Aurélien Gâteau 4a426d731d kwin: Fix build on arm
CCMAIL: ubuntu@kitterman.com
2013-06-26 10:13:33 +02:00
Casian Andrei 8f92e2ab91 Avoid calling expensive GLShader::setUniform overload
REVIEW: 111196
2013-06-24 21:34:32 +03:00
Casian Andrei 40acb1da14 Remove unnecessary checkGLError() calls from color correction
Keep only the ones that should only be called once

REVIEW: 111060
2013-06-24 21:33:56 +03:00
Casian Andrei 79c35d0164 Enable color correction only after successfuly contacting KolorManager
Prevents the possiblity of using shaders modified for color correction
without valid data from KolorManager. If that happened, everthing
blacked out.

Now the color correction shaders are enabled only after successfuly
contacting KolorManager.

The issue was highlighted after ab7e228d.

BUG: 321217
2013-06-18 17:27:34 +03:00
Fredrik Höglund 2fc2004119 kwin: Reset the dirty flags in GLTexture
m_wrapModeChanged and m_filterChanged were never set to false,
causing the sampler parameters to be set every time a texture was bound.
2013-06-13 18:46:34 +02:00
Fredrik Höglund 9d03e16c34 kwin: Check that color correction is enabled in setupForOutput()
Return early if color correction is disabled, so this function
becomes a no-op in that case.
2013-06-11 23:28:48 +02:00
Fredrik Höglund 15dae59999 kwin: add a GLVertexBuffer::draw() overload
This overload doesn't take a clip region. Added for symmetry
with the render() method.
2013-06-11 05:11:41 +02:00
Thomas Lübking 88be3d0caf ensure to init animationeffect bindings
it seems an animation can be triggered and the resp.
window deleted in the first event cycle (before the deleted
signal is bound) - so we add an initialization flag to ensure
the binding happens before the first animation is added

BUG: 320562
FIXED-IN: 4.11
REVIEW: 110872
2013-06-10 16:38:03 +02:00
Martin Gräßlin 5660801192 Add DecorationOpacity to AnimationEffect
Just like Opacity for transforming only the decoration opacity.

It's an ABI break as the new enum value had to be included as anonther
non-float base value.
2013-06-05 08:27:09 +02:00
Martin Gräßlin 941c02a60f Introduce cross-fading with previous pixmap
Cross fading with previous pixmap is achieved by referencing the old
window pixmap. WindowPaintData has a cross-fade-factor which interpolates
between 0.0 (completely old pixmap) to 1.0 (completely new pixmap).

If a cross fading factor is set and a previous pixmap is valid this one
is rendered on top of the current pixmap with opacity adjusted. This
results in a smoother fading.

To simplify the setup the AnimationEffect is extended and also takes care
about correctly (un)referencing the previous window pixmap. The maximize
effect is adjusted to make use of this new capabilities.

Unfortunately this setup has a huge problem with the case that the window
decoration gets smaller (e.g. from normal to maximized state). In this
situation it can happen that the old window is rendered with parts outside
the content resulting in video garbage being shown. To prevent this a set
of new WindowQuads is generated with normalized texture coordinates in
the safe area which contains real content.

For OpenGL2Window a PreviousContentLeaf is added which is only set up in
case the crass fading factor is set.

REVIEW: 110578
2013-06-05 08:18:28 +02:00
Fredrik Höglund 40918e0193 kwin: Make WindowQuadList inherit from QVector
This avoids the overhead of allocating each WindowQuad on the heap
when appending items to the list, and also ensures that the quads
are continuous in memory.
2013-06-05 00:43:17 +02:00
Fredrik Höglund dbbda21129 kwin: Support quads in makeInterleavedArrays()
A new type parameter is added for specifying the primitive type.
2013-06-05 00:41:24 +02:00
Fredrik Höglund 7e22bd314c kwin: Add support for rendering quads using an index buffer
This reduces the size of the geometry that needs to be uploaded by
one-third, and allows kwin to take advantage of the post-transform
cache in the GPU.
2013-06-05 00:41:24 +02:00
Fredrik Höglund 479ea5db61 kwin: Resolve functions for GL_ARB_copy_buffer 2013-06-05 00:41:24 +02:00
Fredrik Höglund 5e7b2a34a8 kwin: Resolve functions for GL_ARB_draw_elements_base_vertex 2013-06-05 00:41:23 +02:00
Fredrik Höglund 993b50cf1c kwin: Add a new GLVertexBuffer::draw() method
Expose bindArrays(), unbindArrays() and add a draw() method that takes
an offset and a count. This makes it possible to upload geometry, call
bindArrays(), and then call draw() multiple times to draw different
subsets of the uploaded geometry.
2013-06-05 00:41:23 +02:00
Fredrik Höglund ac5f1317e9 kwin: Split WindowQuadDecoration into two types
Split WindowQuadDecoration into WindowQuadDecorationLeftRight
and WindowQuadDecorationTopBottom.

This simplifies the code in SceneOpenGL::Window::paintDecoration().
2013-06-05 00:41:22 +02:00
Martin Gräßlin 4b4646973b Use QList<KWin::EffectWindow*> as return type for mainWindows()
QtScript bindings fails when using EffectWindowList.
2013-06-04 17:17:08 +02:00
Martin Gräßlin aa92d2dbd9 No repaints for keepAtTarget and before started
Do not schedule repaints in AnimationEffect if there are no animations
going on. If an animation is waiting for starting or kept after ending
the visual appearance is no longer changed, so no repaint is needed.

REVIEW: 110795
2013-06-03 15:45:02 +02:00
Fredrik Höglund d6fadfa91c kwin: Add an SSE2 vertex upload path
Use MOVNTDQ instructions to write vertex data into the buffer object.
2013-05-29 17:53:08 +02:00
Fredrik Höglund de4b7e8db1 kwin: Add WindowQuadList::makeInterleavedArrays()
Unlike makeArrays() this function writes into a pre-allocated array,
and takes a matrix that's used to transform the texture coordinates.
This allows this function to handle coordinates for rectangular
textures correctly.
2013-05-28 18:13:06 +02:00
Fredrik Höglund a5a2561f69 kwin: Simplify WindowQuadList::makeArrays()
Note that unlike the previous commit, this doesn't fix texture coordinates
for rectangular textures. That case cannot be handled correctly without
knowing the dimensions of the texture.
2013-05-28 16:35:37 +02:00
Fredrik Höglund d4aacd678e kwin: Add more accessors in WindowVertex
Reorder some of the methods and add new u() and v() accessors,
which are aliases of textureX() and textureY().
2013-05-28 16:35:37 +02:00
Fredrik Höglund 7a99b8c0ef kwin: Add GLTexture::matrix()
This method returns a matrix that transforms normalized or un-normalized
texture coordinates, taking the texture target and y-inversion flag into
account.
2013-05-28 16:35:36 +02:00
Fredrik Höglund 38678bb84f kwin: Don't unbind vertex array buffers
KWin always updates the array buffer binding before it calls GL functions
that reference it, so there is never any need to reset it.

This should eliminate half the calls to glBindBuffer() while painting
the scene.
2013-05-28 16:35:36 +02:00