From 0392acd8753f1f7367eef8d153a90967ddeb7db8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 19 Nov 2016 08:05:42 -0500 Subject: [PATCH] Reduce the text shadow warnings They make it hard to see other useful information. --- gtk/gtkrendericon.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gtk/gtkrendericon.c b/gtk/gtkrendericon.c index a850627a66..9578ea4f30 100644 --- a/gtk/gtkrendericon.c +++ b/gtk/gtkrendericon.c @@ -98,6 +98,7 @@ gtk_css_style_snapshot_icon (GtkCssStyle *style, const GtkCssValue *shadows, *transform; graphene_matrix_t transform_matrix, m1, m2, m3, saved_matrix; GtkCssImage *image; + static gboolean shadow_warning; g_return_if_fail (GTK_IS_CSS_STYLE (style)); g_return_if_fail (snapshot != NULL); @@ -121,9 +122,10 @@ gtk_css_style_snapshot_icon (GtkCssStyle *style, graphene_matrix_multiply (&m2, &m3, &m1); gtk_snapshot_transform (snapshot, &m1); - if (!_gtk_css_shadows_value_is_none (shadows)) + if (!_gtk_css_shadows_value_is_none (shadows) && !shadow_warning) { g_warning ("Painting shadows not implemented for textures yet."); + shadow_warning = TRUE; } gtk_css_image_builtin_snapshot (image, snapshot, width, height, builtin_type); @@ -254,6 +256,7 @@ gtk_css_style_snapshot_icon_texture (GtkCssStyle *style, graphene_rect_t bounds; GskRenderNode *node; int width, height; + static gboolean shadow_warning; g_return_if_fail (GTK_IS_CSS_STYLE (style)); g_return_if_fail (snapshot != NULL); @@ -279,9 +282,10 @@ gtk_css_style_snapshot_icon_texture (GtkCssStyle *style, graphene_rect_init (&bounds, 0, 0, width, height); node = gtk_snapshot_append (snapshot, &bounds, "Icon"); - if (!_gtk_css_shadows_value_is_none (shadows)) + if (!_gtk_css_shadows_value_is_none (shadows) && !shadow_warning) { g_warning ("Painting shadows not implemented for textures yet."); + shadow_warning = TRUE; } gsk_render_node_set_texture (node, texture); gsk_render_node_unref (node);