windowManager: Use an off-screen buffer for window dimming

The way the window dimmer shader is applied will cause rendering errors with
the rounded corners, invisible borders or shaped textures since it doesn't deal
well with the multitexturing used by the MetaShapedTexture. Use an off-screen
buffer to flatten the texture before being applied.

https://bugzilla.gnome.org/show_bug.cgi?id=659302
This commit is contained in:
Jasper St. Pierre
2011-09-17 03:06:00 -04:00
parent 543b29efe7
commit 82eccb566c
4 changed files with 58 additions and 30 deletions

View File

@ -850,3 +850,31 @@ shell_parse_search_provider (const char *data,
return FALSE;
}
/**
* shell_shader_effect_set_double_uniform:
* @effect: The #ClutterShaderEffect
* @name: The name of the uniform
* @value: The value to set it to.
*
* Set a double uniform on a ClutterShaderEffect.
*
* The problem here is that JavaScript doesn't have more than
* one number type, and gjs tries to automatically guess what
* type we want to set a GValue to. If the number is "1.0" or
* something, it will use an integer, which will cause errors
* in GLSL.
*/
void
shell_shader_effect_set_double_uniform (ClutterShaderEffect *effect,
const gchar *name,
gdouble value)
{
GValue gvalue = G_VALUE_INIT;
g_value_init (&gvalue, G_TYPE_DOUBLE);
g_value_set_double (&gvalue, value);
clutter_shader_effect_set_uniform_value (effect,
name,
&gvalue);
}