Commit graph

125 commits

Author SHA1 Message Date
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
af92a4efd4 kwin: Rename sample to sampler in all shaders
A sample is not the same thing as a sampler.
2011-02-17 19:19:40 +01:00
Jammy Zhou
6eb24bf374 improve GLVertexBuffer::render function
add a new function fallbackPainting to GLVertexBufferPrivate class
replace the hard-coded index values for vertex and texCoords attributes in corePainting

Reviewed by: Martin Gräßlin <mgraesslin@kde.org>
2011-02-15 10:00:21 +08: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
175b45c5de kwin: Fix an uninitialized member in GLShader.
mLocationsResolved wasn't being initialized in one of the constructors.
2011-02-12 01:23:59 +01:00
Fredrik Höglund
50e19e2cbc kwin: Simplify ShaderManager::resetShader() 2011-02-10 21:36:24 +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
85e9b6713f kwin: Add additional setUniform() overloads
These are specialized overloads for setting the uniforms used
in the standard GLSL shaders in kwin.
2011-02-10 19:16:04 +01:00
Marco Martin
a12acccd3b Merge branch 'master' into plasma/keyboard_applet_svgtext/mart 2011-02-07 20:10:26 +01:00
Thomas Lübking
b65f05f42b sanitize GL version stringlist
BUG: 265131
2011-02-06 17:21:56 +01:00
Martin Gräßlin
fc54bdfe89 Unbind shader before copying pixels to back buffer.
This solves the regression with NVIDIA drivers resulting in a black screen.
Apparently NVIDIA does not support glXCopySubBuffer and the copying of pixels
fails with a shader bound.

So unbinding the shader before copying the pixels and rebinding the shader
afterwards resolves the issue.

This allows to remove the temporary hack to make NVIDIA work, again.
2011-02-06 09:30:04 +01:00
Martin Gräßlin
e2d4cba4c8 Temporarily workaround regression with NVIDIA.
KWin's new shaders fail with NVIDIA and present just a black screen
for the ortho shader (generic shader seems to work). Temporarily
disabling the shaders to force a fallback to old rendering code.

Of course the bug in the shader needs to be fixed.
2011-02-05 13:51:52 +01:00
Martin Gräßlin
154e3e61b0 Temporarily workaround regression with NVIDIA.
KWin's new shaders fail with NVIDIA and present just a black screen
for the ortho shader (generic shader seems to work). Temporarily
disabling the shaders to force a fallback to old rendering code.

Of course the bug in the shader needs to be fixed.
2011-02-05 12:06:32 +01:00
Fredrik Höglund
03ba96420a kwin: Add overloads for setUniform() that take a location. 2011-02-04 21:23:29 +01:00
Martin Gräßlin
9bfef5d4ca Drop addQuadVertices from kwinglutils.
KWin does not use GL_QUADS anymore for rendering windows.
This makes this method rather useless and isn't used anywhere either.
2011-02-04 21:23:29 +01:00
Martin Gräßlin
9814a8e81b Remove renderGLGeometry from kwinglutils.
Not used anymore - completely replaced by VBO.
2011-02-04 21:23:29 +01:00
Fredrik Höglund
5cbd1d458b kwin: Static member variables shouldn't have the m prefix. 2011-02-04 21:23:29 +01:00
Fredrik Höglund
cf58a57cf4 kwin: Fix a compiler warning about initialization order. 2011-02-04 21:23:29 +01:00
Fredrik Höglund
4dd9ef3327 kwin: Clean up the shader compilation code a bit. 2011-02-04 21:23:29 +01:00
Fredrik Höglund
ca8857a4d9 kwin: Change the shader source code parameters from QStrings to QByteArrays.
This eliminates the QByteArray -> QString -> QByteArray conversions.
2011-02-04 21:23:28 +01:00
Fredrik Höglund
8bc586e613 kwin: Add overloads for setUniform() that take a location. 2011-02-04 19:57:19 +01:00
Martin Gräßlin
859dadffd8 Drop addQuadVertices from kwinglutils.
KWin does not use GL_QUADS anymore for rendering windows.
This makes this method rather useless and isn't used anywhere either.
2011-02-04 19:46:20 +01:00
Martin Gräßlin
2e2a7948fb Remove renderGLGeometry from kwinglutils.
Not used anymore - completely replaced by VBO.
2011-02-04 19:38:27 +01:00
Fredrik Höglund
f7633fff23 kwin: Static member variables shouldn't have the m prefix. 2011-02-04 17:32:13 +01:00
Fredrik Höglund
9dfc0332c6 kwin: Fix a compiler warning about initialization order. 2011-02-04 17:06:28 +01:00
Fredrik Höglund
f21ccf028a kwin: Clean up the shader compilation code a bit. 2011-02-04 17:03:56 +01:00
Fredrik Höglund
9f41472085 kwin: Change the shader source code parameters from QStrings to QByteArrays.
This eliminates the QByteArray -> QString -> QByteArray conversions.
2011-02-04 16:41:55 +01:00
Martin Gräßlin
0a7e48f7aa KWin uses kdelibs coding style. 2011-01-31 20:07:03 +01:00
Martin Gräßlin
36daa74589 Combine custom vertex with built-in fragment shader. 2011-01-30 14:12:06 +01:00
Martin Gräßlin
a478fc7ff3 Allow creating shaders from code directly. 2011-01-30 14:12:05 +01:00
Martin Gräßlin
f78d838fc7 Better support custom shaders. 2011-01-30 14:12:05 +01:00
Martin Gräßlin
61615ea7ff Need to copy QPixmap to QImage in GLES.
The Image extension seems to need the pixmap around and that's something
we cannot guarantee in the generic case.
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
6252421a70 Disable clipping when rendering infiniteRegion 2011-01-30 14:12:04 +01:00
Martin Gräßlin
efb82daf30 Adding high-level method for glLoadMatrix 2011-01-30 14:12:03 +01:00
Martin Gräßlin
e49345872c Add high-level functions for <push|pop|mult>Matrix.
All methods are no-ops for GLES which allows to use them from
effects without checks for GLES.
2011-01-30 14:12:03 +01:00
Martin Gräßlin
7adc29efd7 Remove warnings when building with GLES 2011-01-30 14:12:03 +01:00
Martin Gräßlin
4e36027924 Drop unused bindAttribute Location function. 2011-01-30 14:12:03 +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
a4e4752109 Combine built-in vertex with custom fragment shader
ShaderManager supports a new concept to load just a fragment shader from file
and use a built-in shader for the vertex shader. This allows an effect to use
a custom fragment shader.
2011-01-30 14:12:02 +01:00
Martin Gräßlin
1ba818044f Read a matrix uniform back from shader.
Might require additions to kwinglutils_func in desktop profile
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
69044f10c5 GLShader appends the ES specific commands to the shaders 2011-01-30 14:12:01 +01:00
Martin Gräßlin
45f42cdea9 Adding a shared VBO for streaming data. 2011-01-30 14:12:00 +01:00
Martin Gräßlin
a352a0e6a8 Remove implemented TODO marker 2011-01-30 14:12:00 +01:00
Martin Gräßlin
910ba17444 VBO uses ShaderManager to get current bound shader 2011-01-30 14:12:00 +01:00
Martin Gräßlin
753df55973 Set Color as a uniform 2011-01-30 14:12:00 +01:00
Martin Gräßlin
3c6e7309f2 New ShaderManager
The ShaderManager provides the built-in shaders for scene and effects.
Scene and effects can simply push one of those built-in shaders or a
custom one on a stack ensuring that the previously bound shader will be
rebound when the shader is poped again.

The class will be extended to not only have built-in shaders but also to
load custom shaders and being the only way to bind a shader at all.
2011-01-30 14:11:59 +01:00
Martin Gräßlin
a182744648 Fix color rendering 2011-01-30 14:11:59 +01:00
Martin Gräßlin
9bbb852f0c Resolve EGL and GLES function pointers 2011-01-30 14:11:59 +01:00