[gtk/wip/chergert/macos-perf-fixes: 4/7] gsk: make gsk_render_node_get_node_type() use const




commit 86c5f2df6ebb973cfbb16eb69021b210d97ad0e1
Author: Christian Hergert <chergert redhat com>
Date:   Wed Feb 3 20:53:23 2021 -0800

    gsk: make gsk_render_node_get_node_type() use const
    
    There isn't any state to modify in the type so we can use const here.
    Doing so allows some of the renderer code to use const across a
    number of functions so that repeated calls are elided if inlined.

 gsk/gskrendernode.c | 2 +-
 gsk/gskrendernode.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gsk/gskrendernode.c b/gsk/gskrendernode.c
index f0980ba369..7b292e3c27 100644
--- a/gsk/gskrendernode.c
+++ b/gsk/gskrendernode.c
@@ -389,7 +389,7 @@ gsk_render_node_unref (GskRenderNode *node)
  * Returns: the type of the #GskRenderNode
  */
 GskRenderNodeType
-gsk_render_node_get_node_type (GskRenderNode *node)
+gsk_render_node_get_node_type (const GskRenderNode *node)
 {
   g_return_val_if_fail (GSK_IS_RENDER_NODE (node), GSK_NOT_A_RENDER_NODE);
 
diff --git a/gsk/gskrendernode.h b/gsk/gskrendernode.h
index 27ce9224b3..b46a0d463e 100644
--- a/gsk/gskrendernode.h
+++ b/gsk/gskrendernode.h
@@ -118,7 +118,7 @@ GDK_AVAILABLE_IN_ALL
 void                    gsk_render_node_unref                   (GskRenderNode *node);
 
 GDK_AVAILABLE_IN_ALL
-GskRenderNodeType       gsk_render_node_get_node_type           (GskRenderNode *node);
+GskRenderNodeType       gsk_render_node_get_node_type           (const GskRenderNode *node);
 
 GDK_AVAILABLE_IN_ALL
 void                    gsk_render_node_get_bounds              (GskRenderNode   *node,


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