mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
clutter/text: Don't paint background
The background is already painted by clutter_actor_paint_node(), there's no need to (re)paint the background. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3007>
This commit is contained in:
parent
28774a23aa
commit
8f6ebe4800
@ -2586,7 +2586,6 @@ clutter_text_paint (ClutterActor *self,
|
||||
gint text_x = priv->text_x;
|
||||
gint text_y = priv->text_y;
|
||||
gboolean clip_set = FALSE;
|
||||
gboolean bg_color_set = FALSE;
|
||||
guint n_chars;
|
||||
float alloc_width;
|
||||
float alloc_height;
|
||||
@ -2608,36 +2607,6 @@ clutter_text_paint (ClutterActor *self,
|
||||
default_color_pipeline = cogl_pipeline_new (ctx);
|
||||
}
|
||||
|
||||
g_assert (default_color_pipeline != NULL);
|
||||
|
||||
g_object_get (self, "background-color-set", &bg_color_set, NULL);
|
||||
if (bg_color_set)
|
||||
{
|
||||
CoglPipeline *color_pipeline = cogl_pipeline_copy (default_color_pipeline);
|
||||
ClutterColor bg_color;
|
||||
|
||||
clutter_actor_get_background_color (self, &bg_color);
|
||||
bg_color.alpha = clutter_actor_get_paint_opacity (self)
|
||||
* bg_color.alpha
|
||||
/ 255;
|
||||
|
||||
cogl_color_init_from_4ub (&color,
|
||||
bg_color.red,
|
||||
bg_color.green,
|
||||
bg_color.blue,
|
||||
bg_color.alpha);
|
||||
cogl_color_premultiply (&color);
|
||||
cogl_pipeline_set_color (color_pipeline, &color);
|
||||
|
||||
cogl_framebuffer_draw_rectangle (fb,
|
||||
color_pipeline,
|
||||
0, 0,
|
||||
clutter_actor_box_get_width (&alloc),
|
||||
clutter_actor_box_get_height (&alloc));
|
||||
|
||||
cogl_object_unref (color_pipeline);
|
||||
}
|
||||
|
||||
/* don't bother painting an empty text actor, unless it's
|
||||
* editable, in which case we want to paint at least the
|
||||
* cursor
|
||||
|
Loading…
Reference in New Issue
Block a user