Commit Graph

10539 Commits (993b50cf1cc653c440bff3cc6d30d45d9cac4bce)

Author SHA1 Message Date
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 40d6bd66d4 kwin: Refactor SceneOpenGL::Window
Reimplement performPaint() in SceneOpenGL1Window and SceneOpenGL2Window.

The roles between begin/endRenderWindow() and performPaint() are now
reversed; performPaint() contains the specialized code while begin/
endRenderWindow() contains the shared code.

This reduces the state churn in the OpenGL2 backend from the repeated
calls to prepare/restoreStates().
2013-06-05 00:41:23 +02:00
Fredrik Höglund 631769d18f kwin: Rename SceneOpenGL::debug to m_debug and add an accessor 2013-06-05 00:41:23 +02:00
Fredrik Höglund 4f2d12a4a7 kwin: Rename SceneOpenGL::Window::texture to m_texture 2013-06-05 00:41:23 +02:00
Fredrik Höglund 7bac2dd425 kwin: Add new convenience methods in SceneOpenGL
Add a paintRedirector() and a getDecorationTextures() method.
These will be used in an upcoming commit.
2013-06-05 00:41:22 +02:00
Fredrik Höglund 70921b8119 kwin: Make hardwareClipping a member 2013-06-05 00:41:22 +02:00
Fredrik Höglund c92f65583a kwin: Clear the decoration textures after resizing
This fixes artifacts from over-sampling along the edges of the
decorations when effects such a wobbly windows are active.

The textures are only cleared when framebuffer objects are supported.
All drivers support FBO's now, so in practice this shouldn't be
a problem.
2013-06-05 00:41:22 +02:00
Fredrik Höglund d0703292fc kwin: Align decoration texture sizes to 128 pixels
This reduces the number of texture reallocations while
resizing windows.
2013-06-05 00:41:22 +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
Fredrik Höglund 120e65b2c1 kwin: Use texture atlases for the decorations
Use two textures per window instead of four, storing the left and
right borders in the first texture, and the top and bottom borders
in the second.

This makes it possible to render the whole decoration with only two
calls to glDrawArrays(). It also reduces the number of texture
allocations while resizing a window.
2013-06-05 00:41:22 +02:00
Fredrik Höglund e862bfe569 kwin: Refactor some code in the PaintRedirector
Add virtual resizePixmaps() and updatePixmaps() methods that resizes and
updates all the pixmaps. Make resize() and paint() regular virtuals
with stub implementations.

The new methods will be used by OpenGLPaintRedirector in the next commit.
2013-06-05 00:41:22 +02:00
Martin Gräßlin 1fd779695f Rewrite of dialog parent effect in JavaScript
REVIEW: 110802
2013-06-04 17:17:08 +02:00
Martin Gräßlin a4ec610d23 Copy modal state and mainWindows from Client to Deleted
Otherwise it's not possible to access them in the windowClosed handler.
That the dialog parent effect worked at all was pure chance.
2013-06-04 17:17:08 +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 76c207df09 Helper effect for KScreen integration
This effect is controlled by KScreen. It fades out all windows when
KScreen requests this and gives feedback to KScreen once all windows are
faded out. This allows KScreen to adjust the screens in a flicker free
way.

REVIEW: 110661
BUG: 319994
FIXED-IN: 4.11
2013-06-04 17:06:42 +02:00
Martin Gräßlin 2657476db0 Safety checks in cube and coverswitch if shaders are not available
Do not try to load the shaders if using the OpenGL1 compositor - it
might crash the driver.

REVIEW: 110798
2013-06-04 17:04:27 +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
Albert Astals Cid bbdbcdec23 Merge remote-tracking branch 'origin/KDE/4.10'
Conflicts:
	CMakeLists.txt
2013-05-30 21:04:08 +02:00
l10n daemon script fb6d08435d SVN_SILENT made messages (.desktop file) 2013-05-30 07:03:06 +00:00
l10n daemon script 020f6fd612 SVN_SILENT made messages (.desktop file) 2013-05-30 04:29:57 +00:00
Fredrik Höglund feb6fa3aea kwin: Remove makeDecorationArrays()
There is no longer any reason why the decorations cannot be rendered
with renderQuads().
2013-05-29 18:17:57 +02:00
Fredrik Höglund 5b445b1706 kwin: Set the texcoords in the decoration quads
This way we don't have to compute them in makeDecorationArrays().
2013-05-29 18:17:57 +02:00
Fredrik Höglund 49e78a3507 kwin: Optimize shadow quad selection
Loop over the window quad list once instead of eight times when
selecting the shadow quads.
2013-05-29 18:17:57 +02:00
Fredrik Höglund c8e3d670e7 kwin: Optimize decoration quad selection
Loop directly over the window quad list and check the type instead of
using select(WindowQuadDecoration) when separating the decoration quads.

This avoids the step of creating an intermediate list, and then looping
over that list to separate out the quads that belong to the four sides.
2013-05-29 18:17:57 +02:00
Fredrik Höglund 9c348c9a82 kwin: Refactor the decoration code a bit 2013-05-29 18:17:57 +02:00
Fredrik Höglund 1f6b791f11 kwin: Declare the attribute layout once in SceneOpenGL::Window
The same layout is used for all draw calls in
SceneOpenGL::Window::performPaint().
2013-05-29 18:17:46 +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
Alexandr Akulich cb3f1b7776 Polish Plastik theme.
Fixed caption and left buttons positions.
Added enphasizing line under titleRow. (like in 4.9.x version).

REVIEW: 109992
BUG: 317220
FIXED-IN: 4.11
2013-05-29 07:34:13 +02:00
l10n daemon script 34a332742c SVN_SILENT made messages (.desktop file) 2013-05-29 02:52:52 +00:00
Allen Winter ecb9c1cf5a Add a hack for compiling xcb/xcb_icccm.h with C++.
xcb/xcb_iccm.h isn't C++ safe (some versions) because it has
a variable called "class" in function signatures. The hack
is to define "class" to something else before that header is
included, and then undef "class" immediately afterwards.

CCMAIL: mgraesslin@kde.org, fredrik@kde.org
2013-05-28 19:02:58 -04:00
Oliver Henshaw 47acf4ee9a Merge remote-tracking branch 'origin/KDE/4.10' into master
Conflicts:
	kwin/scripting/scripting.cpp
	powerdevil/daemon/actions/bundled/powerdevildimdisplayaction.desktop
	solid-actions-kcm/device-actions/solid-device-SerialInterface.desktop
2013-05-28 17:36:53 +01:00
Oliver Henshaw b61bca0f3d add qml import paths in correct order
addImportPath prepends the path to importPathList so we must add our
paths in reverse order.

Based on the fix for kdeclarative.cpp in kdelibs
400b9f2e9d10386bb175b6123fe0cdaafeaffe61

REVIEW: 110670
2013-05-28 17:23:19 +01:00
Oliver Henshaw 2d5ebd3b8d Replace foreach with java-style iterator
In preparation for reversing the loop.

REVIEW: 110670
2013-05-28 17:23:09 +01:00
Oliver Henshaw bf044bf509 Drop unneeded duplicate addImportPath
Let KDeclarative::setupBindings() add the import paths: it too takes
paths from KGlobal::dirs()->findDirs("module", "imports"); it adds paths
in the correct (reverse) order [1].

[1] See kdelibs 400b9f2e9d10386bb175b6123fe0cdaafeaffe61 for further
details.

REVIEW: 110670
2013-05-28 17:21:48 +01:00
Fredrik Höglund 9c1833920c kwin: Use the new map() interface in renderQuads()
Write the vertex data directly into the buffer object, instead of
allocating two temporary arrays, coyping the data into them, and
then copying the data from the arrays into the buffer object.

This also makes renderQuads() handle coordinates for rectangular
textures correctly.
2013-05-28 18:13:34 +02:00
Fredrik Höglund 7a00648195 kwin: Use the new map() interface in makeDecorationArrays()
Write the vertex data directly into the buffer object, instead of
allocating two temporary arrays, copying the data into them, and
then copying the data from arrays into the buffer object.
2013-05-28 18:13:34 +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 6891c900b3 kwin: Simplify makeDecorationArrays()
This also fixes coordinate inversion for rectangular textures.
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
Fredrik Höglund 159bcf11b6 kwin: Simplify the two setData() methods
Simplify the two setData() methods in GLVertexBuffer by implementing
them in terms of the new map() and unmap() methods.
2013-05-28 16:35:36 +02:00
Fredrik Höglund 188e6d04ca kwin: Expose a map() and an unmap() method in GLVertexBuffer
These methods make it possible to write directly into the buffer object
when building vertex arrays.

If the buffer object cannot be mapped, the map() method will return
a pointer to local memory which will be submitted to the buffer object
with glBufferData() when unmap() is called.
2013-05-28 16:35:36 +02:00
Fredrik Höglund ab8c6aeec3 kwin: Add a new setData() method in GLVertexBuffer
This overload makes it possible to upload data of an arbitrary size and
type into the buffer object.  The intent is for this method to be used
to upload interleaved vertex data.

This commit also adds setVertexCount() and setAttribLayout().

The rationale for decoupling attribute specification from data uploading
is that the attribute formats and layout change less frequently than
the vertex data.

The vertex count is also specified using a separate function to enable
the caller to upload data for multiple draw calls at the same time.
2013-05-28 16:35:35 +02:00
Fredrik Höglund 395ff72555 kwin: Change the way attrib formats are stored in GLVertexBuffer
Store the formats as an array in GLVertexBufferPrivate.

This simplifies the code for enabling the generic vertex arrays,
and also makes it easier to add new arrays.
2013-05-28 16:35:35 +02:00
Fredrik Höglund 1de20a39a0 kwin: Add convenience classes for working with bitfields 2013-05-28 16:35:35 +02:00
Fredrik Höglund 5782d5307e kwin: Add a Color uniform in GLShader
And use it in GLVertexBufferPrivate::bindArrays(). Also store the color
as a QVector4D in GLVertexBufferPrivate.
2013-05-28 16:35:35 +02:00
Fredrik Höglund c41d05d36c kwin: Do some more refactoring in GLVertexBuffer
Consolidate the code for binding and unbinding the vertex arrays into
two new methods called bindArrays() and unbindArrays() respectively.

This patch also removes the three paint implementations, since the only
difference between them is the code that sets up the arrays. The actual
painting code is moved into GLVertexBuffer::render(), which uses the
new methods to bind and unbind the arrays.
2013-05-28 16:35:35 +02:00
Martin Gräßlin 3f69bb0e7f Change Client's clormap to xcb_colormap_t
At same time also renaming variable to follow naming scheme and have a
sensible name. Also moved default value initialization into initializer
list.

REVIEW: 110283
2013-05-28 11:55:39 +02:00