BigRectangle: Use pre-multiplied colors

With recent Clutter changes to the default blend mode, premultiplied
colors should be used for cogl_material_set_color() in the normal
case.

http://bugzilla.gnome.org/show_bug.cgi?id=585473
This commit is contained in:
Owen W. Taylor 2009-05-14 10:00:22 -04:00
parent b131ecc42a
commit 66459eff96

View File

@ -362,7 +362,7 @@ big_rectangle_paint(ClutterActor *actor)
if (radius != 0) { if (radius != 0) {
cogl_color_set_from_4ub(&tmp_color, cogl_color_set_from_4ub(&tmp_color,
0xff, 0xff, 0xff, actor_opacity); actor_opacity, actor_opacity, actor_opacity, actor_opacity);
cogl_material_set_color(rectangle->corner_material, &tmp_color); cogl_material_set_color(rectangle->corner_material, &tmp_color);
cogl_set_source(rectangle->corner_material); cogl_set_source(rectangle->corner_material);
@ -401,6 +401,7 @@ big_rectangle_paint(ClutterActor *actor)
border_color->green, border_color->green,
border_color->blue, border_color->blue,
actor_opacity * border_color->alpha / 255); actor_opacity * border_color->alpha / 255);
cogl_color_premultiply (&tmp_color);
cogl_material_set_color(rectangle->border_material, &tmp_color); cogl_material_set_color(rectangle->border_material, &tmp_color);
cogl_set_source(rectangle->border_material); cogl_set_source(rectangle->border_material);
@ -429,6 +430,7 @@ big_rectangle_paint(ClutterActor *actor)
color->green, color->green,
color->blue, color->blue,
actor_opacity * color->alpha / 255); actor_opacity * color->alpha / 255);
cogl_color_premultiply (&tmp_color);
cogl_material_set_color(rectangle->background_material, &tmp_color); cogl_material_set_color(rectangle->background_material, &tmp_color);
cogl_set_source(rectangle->background_material); cogl_set_source(rectangle->background_material);