mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
Adapt to premultiplied alpha usage in Cogl
Cogl's default blend function has been switched to expect premultiplied alpha. Change the combine function and the colors we use to modulate alpha to match. http://bugzilla.gnome.org/show_bug.cgi?id=585480
This commit is contained in:
parent
7eae5d4eab
commit
442991a712
@ -283,8 +283,7 @@ mutter_shaped_texture_paint (ClutterActor *actor)
|
|||||||
priv->material = cogl_material_new ();
|
priv->material = cogl_material_new ();
|
||||||
|
|
||||||
cogl_material_set_layer_combine (priv->material, 1,
|
cogl_material_set_layer_combine (priv->material, 1,
|
||||||
"RGB = REPLACE (PREVIOUS)"
|
"RGBA = MODULATE (PREVIOUS, TEXTURE[A])",
|
||||||
"A = MODULATE (PREVIOUS, TEXTURE)",
|
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
material = priv->material;
|
material = priv->material;
|
||||||
@ -305,9 +304,12 @@ mutter_shaped_texture_paint (ClutterActor *actor)
|
|||||||
{
|
{
|
||||||
material = priv->material_workaround = cogl_material_new ();
|
material = priv->material_workaround = cogl_material_new ();
|
||||||
|
|
||||||
|
cogl_material_set_layer_combine (material, 0,
|
||||||
|
"RGB = MODULATE (TEXTURE, PREVIOUS)"
|
||||||
|
"A = REPLACE (PREVIOUS)",
|
||||||
|
NULL);
|
||||||
cogl_material_set_layer_combine (material, 1,
|
cogl_material_set_layer_combine (material, 1,
|
||||||
"RGB = REPLACE (PREVIOUS)"
|
"RGBA = MODULATE (PREVIOUS, TEXTURE[A])",
|
||||||
"A = MODULATE (PRIMARY, TEXTURE)",
|
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,8 +322,8 @@ mutter_shaped_texture_paint (ClutterActor *actor)
|
|||||||
|
|
||||||
{
|
{
|
||||||
CoglColor color;
|
CoglColor color;
|
||||||
cogl_color_set_from_4ub (&color, 255, 255, 255,
|
guchar opacity = clutter_actor_get_paint_opacity (actor);
|
||||||
clutter_actor_get_paint_opacity (actor));
|
cogl_color_set_from_4ub (&color, opacity, opacity, opacity, opacity);
|
||||||
cogl_material_set_color (material, &color);
|
cogl_material_set_color (material, &color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ tidy_texture_frame_paint (ClutterActor *self)
|
|||||||
g_assert (priv->material != COGL_INVALID_HANDLE);
|
g_assert (priv->material != COGL_INVALID_HANDLE);
|
||||||
|
|
||||||
/* set the source material using the parent texture's COGL handle */
|
/* set the source material using the parent texture's COGL handle */
|
||||||
cogl_material_set_color4ub (priv->material, 255, 255, 255, opacity);
|
cogl_material_set_color4ub (priv->material, opacity, opacity, opacity, opacity);
|
||||||
cogl_material_set_layer (priv->material, 0, cogl_texture);
|
cogl_material_set_layer (priv->material, 0, cogl_texture);
|
||||||
cogl_set_source (priv->material);
|
cogl_set_source (priv->material);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user