Move testing/demo effects (those not meant for end users) to test/ subdir and don't build them by default.
svn path=/trunk/KDE/kdebase/workspace/; revision=732055
This commit is contained in:
parent
a7c46120b6
commit
d78506bd0a
37 changed files with 126 additions and 51 deletions
|
@ -1,3 +1,7 @@
|
|||
# Uncomment to have the test effects built
|
||||
#add_subdirectory( test )
|
||||
|
||||
|
||||
# Adds effect plugin with given name. Sources are given after the name
|
||||
macro(KWIN4_ADD_EFFECT name)
|
||||
kde4_add_plugin(kwin4_effect_${name} ${ARGN})
|
||||
|
@ -15,20 +19,17 @@ include_directories(
|
|||
${KDEBASE_WORKSPACE_SOURCE_DIR}/kwin/lib
|
||||
)
|
||||
|
||||
install( FILES kwineffect.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
|
||||
|
||||
|
||||
|
||||
### builtins - most important, ready-to-use effects
|
||||
# sources
|
||||
SET(kwin4_effect_builtins_sources
|
||||
boxswitch.cpp
|
||||
demo_taskbarthumbnail.cpp
|
||||
desktopgrid.cpp
|
||||
dialogparent.cpp
|
||||
diminactive.cpp
|
||||
fade.cpp
|
||||
fallapart.cpp
|
||||
flame.cpp
|
||||
maketransparent.cpp
|
||||
minimizeanimation.cpp
|
||||
presentwindows.cpp
|
||||
|
@ -39,12 +40,12 @@ SET(kwin4_effect_builtins_sources
|
|||
# their .desktop files
|
||||
install( FILES
|
||||
boxswitch.desktop
|
||||
demo_taskbarthumbnail.desktop
|
||||
desktopgrid.desktop
|
||||
dialogparent.desktop
|
||||
diminactive.desktop
|
||||
fade.desktop
|
||||
fallapart.desktop
|
||||
flame.desktop
|
||||
maketransparent.desktop
|
||||
minimizeanimation.desktop
|
||||
presentwindows.desktop
|
||||
|
@ -135,52 +136,6 @@ endif (X11_Xrender_FOUND)
|
|||
|
||||
|
||||
|
||||
### tests - meant to test/demo certain functionality, not really usable for end-users
|
||||
SET(kwin4_effect_tests_sources
|
||||
demo_shakymove.cpp
|
||||
demo_shiftworkspaceup.cpp
|
||||
demo_taskbarthumbnail.cpp
|
||||
drunken.cpp
|
||||
howto.cpp
|
||||
test_input.cpp
|
||||
test_thumbnail.cpp
|
||||
)
|
||||
install( FILES
|
||||
demo_shakymove.desktop
|
||||
demo_shiftworkspaceup.desktop
|
||||
demo_taskbarthumbnail.desktop
|
||||
drunken.desktop
|
||||
howto.desktop
|
||||
test_input.desktop
|
||||
test_thumbnail.desktop
|
||||
DESTINATION ${SERVICES_INSTALL_DIR}/kwin )
|
||||
|
||||
if(OPENGL_FOUND)
|
||||
# opengl test/demo stuff
|
||||
SET(kwin4_effect_tests_sources ${kwin4_effect_tests_sources}
|
||||
demo_liquid.cpp
|
||||
demo_showpicture.cpp
|
||||
demo_wavywindows.cpp
|
||||
test_fbo.cpp
|
||||
)
|
||||
|
||||
install( FILES
|
||||
demo_liquid.desktop
|
||||
demo_showpicture.desktop
|
||||
demo_wavywindows.desktop
|
||||
test_fbo.desktop
|
||||
DESTINATION ${SERVICES_INSTALL_DIR}/kwin )
|
||||
|
||||
install( FILES
|
||||
data/liquid.frag
|
||||
data/liquid.vert
|
||||
DESTINATION ${DATA_INSTALL_DIR}/kwin )
|
||||
endif(OPENGL_FOUND)
|
||||
|
||||
# add the plugin
|
||||
KWIN4_ADD_EFFECT(tests ${kwin4_effect_tests_sources})
|
||||
|
||||
|
||||
|
||||
### videocapture plugin
|
||||
include(UsePkgConfig)
|
||||
|
|
63
effects/test/CMakeLists.txt
Normal file
63
effects/test/CMakeLists.txt
Normal file
|
@ -0,0 +1,63 @@
|
|||
# Adds effect plugin with given name. Sources are given after the name
|
||||
macro(KWIN4_ADD_EFFECT name)
|
||||
kde4_add_plugin(kwin4_effect_${name} ${ARGN})
|
||||
target_link_libraries(kwin4_effect_${name} kwineffects ${KDE4_KDEUI_LIBS})
|
||||
install(TARGETS kwin4_effect_${name} DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||
endmacro(KWIN4_ADD_EFFECT)
|
||||
|
||||
macro(KWIN4_ADD_EFFECT_CONFIG name)
|
||||
kde4_add_plugin(kcm_kwin4_effect_${name} ${ARGN})
|
||||
target_link_libraries(kcm_kwin4_effect_${name} kwineffects ${KDE4_KDEUI_LIBS})
|
||||
install(TARGETS kcm_kwin4_effect_${name} DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||
endmacro(KWIN4_ADD_EFFECT_CONFIG)
|
||||
|
||||
include_directories(
|
||||
${KDEBASE_WORKSPACE_SOURCE_DIR}/kwin/lib
|
||||
)
|
||||
|
||||
|
||||
### tests - meant to test/demo certain functionality, not really usable for end-users
|
||||
SET(kwin4_effect_tests_sources
|
||||
demo_shakymove.cpp
|
||||
demo_shiftworkspaceup.cpp
|
||||
drunken.cpp
|
||||
flame.cpp
|
||||
howto.cpp
|
||||
test_input.cpp
|
||||
test_thumbnail.cpp
|
||||
)
|
||||
install( FILES
|
||||
demo_shakymove.desktop
|
||||
demo_shiftworkspaceup.desktop
|
||||
drunken.desktop
|
||||
flame.desktop
|
||||
howto.desktop
|
||||
test_input.desktop
|
||||
test_thumbnail.desktop
|
||||
DESTINATION ${SERVICES_INSTALL_DIR}/kwin )
|
||||
|
||||
if(OPENGL_FOUND)
|
||||
# opengl test/demo stuff
|
||||
SET(kwin4_effect_tests_sources ${kwin4_effect_tests_sources}
|
||||
demo_liquid.cpp
|
||||
demo_showpicture.cpp
|
||||
demo_wavywindows.cpp
|
||||
test_fbo.cpp
|
||||
)
|
||||
|
||||
install( FILES
|
||||
demo_liquid.desktop
|
||||
demo_showpicture.desktop
|
||||
demo_wavywindows.desktop
|
||||
test_fbo.desktop
|
||||
DESTINATION ${SERVICES_INSTALL_DIR}/kwin )
|
||||
|
||||
install( FILES
|
||||
data/liquid.frag
|
||||
data/liquid.vert
|
||||
DESTINATION ${DATA_INSTALL_DIR}/kwin )
|
||||
endif(OPENGL_FOUND)
|
||||
|
||||
# add the plugin
|
||||
KWIN4_ADD_EFFECT(tests ${kwin4_effect_tests_sources})
|
||||
|
50
effects/test/data/liquid.frag
Normal file
50
effects/test/data/liquid.frag
Normal file
|
@ -0,0 +1,50 @@
|
|||
uniform sampler2D sceneTex;
|
||||
uniform float textureWidth;
|
||||
uniform float textureHeight;
|
||||
uniform float time;
|
||||
|
||||
varying vec2 pos;
|
||||
|
||||
|
||||
#define DEG2RAD (6.2832/360.0)
|
||||
|
||||
|
||||
// Converts pixel coordinates to texture coordinates
|
||||
vec2 pix2tex(vec2 pix)
|
||||
{
|
||||
return vec2(pix.x / textureWidth, 1.0 - pix.y / textureHeight);
|
||||
}
|
||||
|
||||
float wave(vec2 pos, vec2 wave_dir, float wave_length, float wave_speed)
|
||||
{
|
||||
return sin(((pos.x * wave_dir.x) + (pos.y * wave_dir.y)) * 6.2832 / wave_length +
|
||||
time * wave_speed * 6.2832 / wave_length);
|
||||
}
|
||||
|
||||
vec2 displacement(float wave_angle, float wave_length, float wave_speed, float wave_height)
|
||||
{
|
||||
vec2 wave_dir = vec2(cos(wave_angle * DEG2RAD), sin(wave_angle * DEG2RAD));
|
||||
return wave_dir * (wave(pos, wave_dir, wave_length, wave_speed) * wave_height);
|
||||
}
|
||||
|
||||
// Only for debugging
|
||||
float wave_color(float wave_angle, float wave_length, float wave_speed, float wave_height)
|
||||
{
|
||||
vec2 wave_dir = vec2(cos(wave_angle * DEG2RAD), sin(wave_angle * DEG2RAD));
|
||||
return wave(pos, wave_dir, wave_length, wave_speed) * 0.5 + 0.5;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 texpos = pos;
|
||||
texpos += displacement( 20.0, 250.0, 120.0, 4.0);
|
||||
texpos += displacement(-40.0, 350.0, 100.0, 4.0);
|
||||
texpos += displacement(240.0, 1000.0, 100.0, 12.0);
|
||||
texpos += displacement(160.0, 50.0, 30.0, 2.0);
|
||||
|
||||
vec3 tex = texture2D(sceneTex, pix2tex(texpos)).rgb;
|
||||
//tex.r = wave_color( 20, 250, 150, 4); // debug
|
||||
|
||||
gl_FragColor = vec4(tex, 1.0);
|
||||
}
|
||||
|
7
effects/test/data/liquid.vert
Normal file
7
effects/test/data/liquid.vert
Normal file
|
@ -0,0 +1,7 @@
|
|||
varying vec2 pos;
|
||||
|
||||
void main()
|
||||
{
|
||||
pos = gl_Vertex.xy;
|
||||
gl_Position = ftransform();
|
||||
}
|
Loading…
Reference in a new issue