Commit Graph

296 Commits (1793343847b5254dc002b5bd9207793d126cbf8f)

Author SHA1 Message Date
Martin Gräßlin 55c1f3ae96 Include transformed windows in quad transition
Only transformed quads may not be changed, so we skip those.
2011-07-05 20:18:20 +02:00
Martin Gräßlin 76eb3c3391 Remove clipping against the bounding rect of paint region 2011-07-05 20:18:19 +02:00
Martin Gräßlin cd82616ece Remove PaintClipper from OpenGL Scene rendering
Construct window quads which will end on the screen instead of
rendering the windows several times and using scissoring to
restrict to the area which will end on screen.

REVIEW: 101765
2011-07-05 20:17:29 +02:00
Martin Gräßlin bb8b92f93d Don't render shadows if there are no quads 2011-07-05 20:15:11 +02:00
Arthur Arlt 02e08be5bd Merge signals clientClosed() and unmanagedClosed() to windowClosed()
This commit merges the two signals clientClosed() and unmanagedClosed() to windowClosed() which
is now provided by Toplevel.
The approriate slots in effects.h and effects.cpp were merges as well, since they did the
same.
The direct method calls of the method windowClosed() in SceneOpenGL and SceneXRender were
removed and are now connected to the appropriate signal in windowAdded().
2011-07-05 11:46:13 +02:00
Arthur Arlt 859dacb8b5 Make Scene::windowClosed() a Q_SLOT
This commit just makes the declaration of windowClosed() in Class Scene be a Q_SLOT.
The inheriting classes SceneOpenGL and SceneXRender are updated as well.
2011-07-05 11:46:13 +02:00
Arthur Arlt b63c9c1af8 Make mothod windowGeometryShapeChanged() a slot
The method windowGeometryShapeChanged() from the class Scene is now a slot. It is now connected to the signal geometryShapeChanged() which is sent from Toplevel instances Client and Unmanaged.
All direct method calls were deleted.
2011-07-05 11:34:12 +02:00
Arthur Arlt 59a8aac752 Make windowOpacityChanged() a slot
The method windowOpacityChanged is now a protected slot in class Scene. The implementations in the subclasses SceneOpenGL and SceneXRender are the same. The slots are connected to the singal opacityChanged() from Toplevel. The connection is done in the method windowAdded() in both SceneOpenGL and SceneXRender.
2011-07-05 11:34:12 +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 f978d7b97d Fix decoration rendering with GL_TEXTURE_RECTANGLE_ARB
When using graphicssystem native the texture may be using
GL_TEXTURE_RECTANGLE_ARB instead of GL_TEXTURE_2D. This
needs to be honoured in order to make KWin work reliable
with e.g. R300 chipsets.

BUG: 274607
CCBUG: 276622
FIXED-IN: 4.7.0
2011-07-01 18:04:15 +02:00
Martin Gräßlin b470ef52a9 Fix major window rendering regression with NPOT textures
The adjusted code for generating texture coordinates did not
take care of GL_TEXTURE_RECTANGLE_ARB textures causing the
generation of wrong texcoords.

BUG: 276622
FIXED-IN: 4.7.0
2011-06-30 17:47:06 +02:00
Martin Gräßlin a05ad98896 Remove textureWidth/textureHeight from all Shaders
The uniforms textureWidth and textureHeight were only needed for
normal windows. For everything else it was just 1.0/1.0, that is
normalized.

The makeArrays method is changed to produce normalized texcoords
obsoleting the need for these uniforms. So two uniforms less, one
calculation in vertex shaders less and many many lines of code
removed.

At the same time makeArrays is also adjusted to take care of
yInverted of the texture, which is needed as we no longer can use
the enableUnnormalizedTexCoords which did the yInverted transformation.

REVIEW: 101646
2011-06-19 20:54:13 +02:00
Thomas Lübking 3af7395ab8 avoid calling QPixmap::paintEngine() in scene rendering
by checking the graphicssystem at startup
also avoid pixmap and memory leaking on the xrender backend, validate some pointers
on deletion in SceneOpnGL and avoid attempts to render ::isNull pixmaps
2011-06-11 15:23:03 +02:00
Philipp Knechtges 5577cc769b kwin: bug fix for crash when using the raster backend
It seems to be possible to generate a QPixmap that is not null,
but doesnt have a paintEngine.
2011-05-19 21:41:30 +02:00
Philipp Knechtges da82739301 kwin: Make SceneOpenGL::makeDecorationArrays aware of Texture::y_inverted 2011-05-18 21:09:59 +02:00
Martin Gräßlin 234ec644d2 KWin supports graphicssystem Raster
With raster a QPixmap is no longer a XPixmap which fails all code
which assumes that an QPixmap is an XPixmap. Depending on were in
the codebase we either convert such pixmaps to images (OpenGL) or
create a XPixmap and use QPixmap::fromX11Pixmap to get a "real"
pixmap.

It is possible that there are more code pathes were we would need
a XPixmap. Currently tested is basic functionality of no-compositing,
XRender compositing, OpenGl/GLX and OpenGL ES/EGL compositing.

For OpenGL compositing raster might result in performance improvements,
for XRender it is possible that there are regressions when using raster.
By default KWin uses whatever is the default of the system, so we just
no longer enforce native.

Of course it is a bad idea to use graphicssystem OpenGL. As that
is broken anyways in Qt, we do not check for it.

Many thanks to Philipp Knechtges for bringing up the issue, convincing
me that we need it and providing most of the patch.

REVIEW: 101132
CCMAIL: Philipp.Knechtges@rwth-aachen.de
2011-05-12 18:52:38 +02:00
Martin Gräßlin 264fcfa49f Remove selfcheck code from OpenGL
Execution was ifdefed, if we want it again we have a VCS.
2011-05-12 17:59:57 +02:00
Martin Gräßlin 022d7a32a0 Remove binding of selection to styled EffectFrame
This allows to just set the selection on a None EffectFrame so
that only the selection is rendered without blurring the background
and so on.
2011-04-28 13:49:22 +02:00
Martin Gräßlin 001b9da6d8 Perform glFlush before deleting the EffectFrame's pixmaps
On NVIDIA it is possible that the actual rendering gets delayed to
after the deletion of the pixmap during the end of fullscreen effects.
This was causing freezes. By using glFlush before deleting the pixmaps
we can ensure that the pixmap is not needed anymore after the pixmaps
are deleted.

BUG: 261323
FIXED-IN: 4.6.3
2011-04-24 20:24:04 +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 ea17b3562c Add debug rendering for shadow code 2011-03-30 20:33:08 +02:00
Martin Gräßlin 0667076fab Shadow texcoords are normalized
Set texture width/height to 1.0, so that we see the shadow.
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
Jammy Zhou 9a8d5c88ae Fix GL error when do texture from pixmap
This problem happens on Freescale imx51 ARM platform

CCMAIL: patches@linaro.org
2011-03-11 09:04:01 +08:00
Martin Gräßlin 57d11c134a Move kwineffects library into own directory
Second part of cleaning up the lib directory: the effects library
now lives in libkwineffects/ directory.

For existing effects nothing changes as the install path is unchanged.
The change obsoletes the lib/ directory.

As glplatform.h has not yet been exported I dared to export it and
adjust the places where it is used.
CCMAIL: kwin@kde.org
2011-02-19 10:01:31 +01:00
Fredrik Höglund d2078d4b9b kwin: Refactor the screen transformation code
Move the code that computes the transformation matrix to its
own method, and rewrite it to improve readability.
2011-02-17 19:19:40 +01:00
Fredrik Höglund 90f6cbfa5e kwin: Fix the clip intersection code
The code that intersected the clip region with the window region
appears to have been accidentally lost in 5ce3c6b8.
2011-02-16 00:08:47 +01:00
Fredrik Höglund 5d29307f58 kwin: Refactor the window transformation code
Move the code that computes the transformation matrix into its own
method, and rewrite it to improve readability.
2011-02-15 23:02:21 +01:00
Fredrik Höglund 423cd29afa kwin: Simplify the code for updating the texture filter 2011-02-15 23:02:21 +01:00
Fredrik Höglund 73be6657ea kwin: Replace brightness and opacity with a modulation constant
This makes it possible to adjust both brightness and opacity
at the same time with one multiplication in the fragment shader.
2011-02-12 01:45:38 +01:00
Fredrik Höglund 2fa966e0f9 kwin: Use the new setUniform() overloads in kwin core 2011-02-10 19:37:51 +01:00
Fredrik Höglund 6a72efea96 kwin: Fix a typo in a setUniform() call 2011-02-10 18:47:52 +01:00
Fredrik Höglund 2a6a4e9667 kwin: Fix the glBlendFunc() in the shader case.
The RGB values were being multiplied by the alpha value twice.
2011-02-04 21:44:50 +01:00
Martin Gräßlin 0a7e48f7aa KWin uses kdelibs coding style. 2011-01-31 20:07:03 +01:00
Fredrik Höglund 8bc99e68c0 Don't specify the texture target explicitly with r300g.
This is reported to cause a performance regression.

FIXED-IN: 4.6.0
BUG: 256654

svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1215519
2011-01-30 15:24:31 +01:00
Martin Gräßlin 2f56415a21 Removing SHM and Fallback OpenGL Compositing modes.
Our primary target is Texture From Pixmap and it is supported
by all important drivers nowadays. If a driver is not able to
support TFP using OpenGL at all is probably no good idea and
XRender is more suited.
2011-01-30 14:24:48 +01:00
Martin Gräßlin f78d838fc7 Better support custom shaders. 2011-01-30 14:12:05 +01:00
Martin Gräßlin d683ce560c Adding new uniform to enforce that alpha becomes 1.0
When rendering opaque (RGB-only) windows the alpha ends up to be 0
with blending disabled. This breaks subsequent rendering steps which
require blenden (e.g. Lanczos). Therefore a uniform is used to ensure
that the alpha channel is set to 1.
2011-01-30 14:12:04 +01:00
Martin Gräßlin 4c8c3060bf Merge together paintBackground and paintGenericScreen 2011-01-30 14:12:04 +01:00
Martin Gräßlin e5eed55c51 PerformPaint uses QMatrix4x4 for legacy GL.
And another piece of code get's merged between desktop GL and ES.
2011-01-30 14:12:04 +01:00
Martin Gräßlin 7adc29efd7 Remove warnings when building with GLES 2011-01-30 14:12:03 +01:00
Martin Gräßlin 2d40f73530 Fix unstyled effect frames 2011-01-30 14:12:02 +01:00
Martin Gräßlin 990001c5d7 Drop GLVertexBuffer::useShader.
The vertex buffer implementation uses the shader manager to decide
whether core painting should be used or not. Shader manager is only
used by shaders using vertex attributes instead of gl_Vertex etc.
2011-01-30 14:12:02 +01:00
Martin Gräßlin 9cfdeb1e2d Set always window transformaton to generic shader 2011-01-30 14:12:01 +01:00
Martin Gräßlin cab9154723 Simple vertex shaders use projection matrix and offset 2011-01-30 14:12:01 +01:00
Martin Gräßlin e4b26daef5 And use shared VBO for windows 2011-01-30 14:12:00 +01:00
Martin Gräßlin d2cfeef8ae Scene uses ShaderManager 2011-01-30 14:12:00 +01:00
Martin Gräßlin d12c4e58fd Support new translate for textures 2011-01-30 14:11:58 +01:00
Martin Gräßlin ae95ab0c43 Adding color to VBO.
A color can be specified to render the geometry of the VBO.
For legacy painting glColor is used, for shader a uniform is set.
In order to allow rendering without texcoords, it is possible to pass
a null pointer as texcoords.
Shader added to scene which just renders a colored geometry without texturing.
2011-01-30 14:11:58 +01:00
Martin Gräßlin f925352e73 Don't crash if scene shader is not available 2011-01-30 14:11:58 +01:00