diff options
author | Benjamin Otte <otte@redhat.com> | 2020-12-03 00:47:54 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2020-12-03 00:47:54 +0100 |
commit | 55a242bd816893e8b3c777b053a3c5fc0266b5d6 (patch) | |
tree | f37db07ad554e499ad7b5b0785e9af53751cc394 /gtk | |
parent | 71cb7c2063a85d4f8d5424e466319f30be318913 (diff) | |
download | gtk+-55a242bd816893e8b3c777b053a3c5fc0266b5d6.tar.gz |
gsk: Add GskConicGradientNode
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/inspector/recorder.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c index dd9a1de67e..7e07e4413a 100644 --- a/gtk/inspector/recorder.c +++ b/gtk/inspector/recorder.c @@ -133,6 +133,7 @@ create_list_model_for_render_node (GskRenderNode *node) case GSK_REPEATING_LINEAR_GRADIENT_NODE: case GSK_RADIAL_GRADIENT_NODE: case GSK_REPEATING_RADIAL_GRADIENT_NODE: + case GSK_CONIC_GRADIENT_NODE: case GSK_BORDER_NODE: case GSK_INSET_SHADOW_NODE: case GSK_OUTSET_SHADOW_NODE: @@ -259,6 +260,8 @@ node_type_name (GskRenderNodeType type) return "Radial Gradient"; case GSK_REPEATING_RADIAL_GRADIENT_NODE: return "Repeating Radial Gradient"; + case GSK_CONIC_GRADIENT_NODE: + return "Conic Gradient"; case GSK_BORDER_NODE: return "Border"; case GSK_TEXTURE_NODE: @@ -308,6 +311,7 @@ node_name (GskRenderNode *node) case GSK_REPEATING_LINEAR_GRADIENT_NODE: case GSK_RADIAL_GRADIENT_NODE: case GSK_REPEATING_RADIAL_GRADIENT_NODE: + case GSK_CONIC_GRADIENT_NODE: case GSK_BORDER_NODE: case GSK_INSET_SHADOW_NODE: case GSK_OUTSET_SHADOW_NODE: @@ -729,6 +733,44 @@ populate_render_node_properties (GtkListStore *store, } break; + case GSK_CONIC_GRADIENT_NODE: + { + const graphene_point_t *center = gsk_conic_gradient_node_get_center (node); + const float rotation = gsk_conic_gradient_node_get_rotation (node); + const gsize n_stops = gsk_conic_gradient_node_get_n_color_stops (node); + const GskColorStop *stops = gsk_conic_gradient_node_get_color_stops (node, NULL); + gsize i; + GString *s; + GdkTexture *texture; + + tmp = g_strdup_printf ("%.2f, %.2f", center->x, center->y); + add_text_row (store, "Center", tmp); + g_free (tmp); + + tmp = g_strdup_printf ("%.2f", rotation); + add_text_row (store, "Rotation", tmp); + g_free (tmp); + + s = g_string_new (""); + for (i = 0; i < n_stops; i++) + { + tmp = gdk_rgba_to_string (&stops[i].color); + g_string_append_printf (s, "%.2f, %s\n", stops[i].offset, tmp); + g_free (tmp); + } + + texture = get_linear_gradient_texture (n_stops, stops); + gtk_list_store_insert_with_values (store, NULL, -1, + 0, "Color Stops", + 1, s->str, + 2, TRUE, + 3, texture, + -1); + g_string_free (s, TRUE); + g_object_unref (texture); + } + break; + case GSK_TEXT_NODE: { const PangoFont *font = gsk_text_node_get_font (node); |