[gtk/wip/chergert/inline-transform-category] gsk: move transform structure to private.h




commit 6fab19564323c0032628f513fa2aa760ca90980d
Author: Christian Hergert <chergert redhat com>
Date:   Wed Feb 10 16:04:20 2021 -0800

    gsk: move transform structure to private.h
    
    This allows using the category without having to call a function from the
    hot paths of the renderer.

 gsk/gsktransform.c        | 12 +-----------
 gsk/gsktransformprivate.h | 11 +++++++++++
 2 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/gsk/gsktransform.c b/gsk/gsktransform.c
index 9361f25b9a..ae8a25d904 100644
--- a/gsk/gsktransform.c
+++ b/gsk/gsktransform.c
@@ -37,16 +37,6 @@
 
 #include "gsktransformprivate.h"
 
-typedef struct _GskTransformClass GskTransformClass;
-
-struct _GskTransform
-{
-  const GskTransformClass *transform_class;
-
-  GskTransformCategory category;
-  GskTransform *next;
-};
-
 struct _GskTransformClass
 {
   gsize struct_size;
@@ -1747,7 +1737,7 @@ gsk_transform_equal (GskTransform *first,
  * Returns: The category of the transform
  **/
 GskTransformCategory
-gsk_transform_get_category (GskTransform *self)
+(gsk_transform_get_category) (GskTransform *self)
 {
   if (self == NULL)
     return GSK_TRANSFORM_CATEGORY_IDENTITY;
diff --git a/gsk/gsktransformprivate.h b/gsk/gsktransformprivate.h
index 9f88e9a002..a7871c35f4 100644
--- a/gsk/gsktransformprivate.h
+++ b/gsk/gsktransformprivate.h
@@ -28,6 +28,15 @@
 
 G_BEGIN_DECLS
 
+typedef struct _GskTransformClass GskTransformClass;
+
+struct _GskTransform
+{
+  const GskTransformClass *transform_class;
+
+  GskTransformCategory category;
+  GskTransform *next;
+};
 
 gboolean                gsk_transform_parser_parse              (GtkCssParser           *parser,
                                                                  GskTransform          **out_transform);
@@ -45,6 +54,8 @@ void gsk_matrix_transform_rect    (const graphene_matrix_t  *m,
                                    const graphene_rect_t    *r,
                                    graphene_quad_t          *res);
 
+#define gsk_transform_get_category(t) ((t) ? (t)->category : GSK_TRANSFORM_CATEGORY_IDENTITY)
+
 G_END_DECLS
 
 #endif /* __GSK_TRANSFORM_PRIVATE_H__ */


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