[gtk+: 5/5] inspector: show color matrix node details



commit dfaed90f678f030569070a067bf1cb12f7f08811
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Oct 23 11:24:49 2017 +0200

    inspector: show color matrix node details
    
    Show the matrix and the offset for color matrix nodes.

 gtk/inspector/recorder.c |   40 ++++++++++++++++++++++++++++++++++++++--
 1 files changed, 38 insertions(+), 2 deletions(-)
---
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
index ff59dd7..35150cf 100644
--- a/gtk/inspector/recorder.c
+++ b/gtk/inspector/recorder.c
@@ -513,13 +513,49 @@ populate_render_node_properties (GtkListStore  *store,
                                child_bounds->origin.y);
         add_text_row (store, "Child Bounds", tmp);
         g_free (tmp);
-     }
+      }
+      break;
+
+    case GSK_COLOR_MATRIX_NODE:
+      {
+        const graphene_matrix_t *matrix = gsk_color_matrix_node_peek_color_matrix (node);
+        const graphene_vec4_t *offset = gsk_color_matrix_node_peek_color_offset (node);
+
+        tmp = g_strdup_printf ("% .2f % .2f % .2f % .2f\n"
+                               "% .2f % .2f % .2f % .2f\n"
+                               "% .2f % .2f % .2f % .2f\n"
+                               "% .2f % .2f % .2f % .2f",
+                               graphene_matrix_get_value (matrix, 0, 0),
+                               graphene_matrix_get_value (matrix, 0, 1),
+                               graphene_matrix_get_value (matrix, 0, 2),
+                               graphene_matrix_get_value (matrix, 0, 3),
+                               graphene_matrix_get_value (matrix, 1, 0),
+                               graphene_matrix_get_value (matrix, 1, 1),
+                               graphene_matrix_get_value (matrix, 1, 2),
+                               graphene_matrix_get_value (matrix, 1, 3),
+                               graphene_matrix_get_value (matrix, 2, 0),
+                               graphene_matrix_get_value (matrix, 2, 1),
+                               graphene_matrix_get_value (matrix, 2, 2),
+                               graphene_matrix_get_value (matrix, 2, 3),
+                               graphene_matrix_get_value (matrix, 3, 0),
+                               graphene_matrix_get_value (matrix, 3, 1),
+                               graphene_matrix_get_value (matrix, 3, 2),
+                               graphene_matrix_get_value (matrix, 3, 3));
+        add_text_row (store, "Matrix", tmp);
+        g_free (tmp);
+        tmp = g_strdup_printf ("%.2f %.2f %.2f %.2f",
+                               graphene_vec4_get_x (offset),
+                               graphene_vec4_get_y (offset),
+                               graphene_vec4_get_z (offset),
+                               graphene_vec4_get_w (offset));
+        add_text_row (store, "Offset", tmp);
+        g_free (tmp);
+      }
       break;
 
     case GSK_NOT_A_RENDER_NODE:
     case GSK_CONTAINER_NODE:
     case GSK_TRANSFORM_NODE:
-    case GSK_COLOR_MATRIX_NODE:
     case GSK_CLIP_NODE:
     case GSK_ROUNDED_CLIP_NODE:
     case GSK_SHADOW_NODE:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]