[gtk/wip/otte/transform: 1/5] transform: Make category public API
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/transform: 1/5] transform: Make category public API
- Date: Sat, 2 Mar 2019 04:18:11 +0000 (UTC)
commit 7f9873afbef16526a8a641600a165096128ce12a
Author: Benjamin Otte <otte redhat com>
Date: Fri Mar 1 07:51:23 2019 +0100
transform: Make category public API
Also rename it from GskMatrixCategory to GskTransformCategory.
gsk/gl/gskglrenderer.c | 21 ++++++------
gsk/gl/gskglrenderops.c | 30 +++++++++--------
gsk/gl/gskglrenderopsprivate.h | 6 ++--
gsk/gskenums.h | 38 ++++++++++++++++++++++
gsk/gskrendernodeimpl.c | 2 +-
gsk/gskrendernodeprivate.h | 38 ----------------------
gsk/gsktransform.c | 74 ++++++++++++++++++++++--------------------
gsk/gsktransform.h | 3 ++
gsk/gsktransformprivate.h | 4 +--
gtk/gtksnapshot.c | 2 +-
gtk/gtksnapshotprivate.h | 2 +-
gtk/gtkwidget.c | 4 +--
gtk/gtkwidgetprivate.h | 2 +-
gtk/inspector/recorder.c | 15 +++++----
14 files changed, 124 insertions(+), 117 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index cc0346f0d8..8066d3b75f 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -793,16 +793,16 @@ render_transform_node (GskGLRenderer *self,
RenderOpBuilder *builder)
{
GskTransform *node_transform = gsk_transform_node_get_transform (node);
- const GskMatrixCategory category = gsk_transform_categorize (node_transform);
+ const GskTransformCategory category = gsk_transform_get_category (node_transform);
GskRenderNode *child = gsk_transform_node_get_child (node);
switch (category)
{
- case GSK_MATRIX_CATEGORY_IDENTITY:
+ case GSK_TRANSFORM_CATEGORY_IDENTITY:
gsk_gl_renderer_add_render_ops (self, child, builder);
break;
- case GSK_MATRIX_CATEGORY_2D_TRANSLATE:
+ case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
{
float dx, dy;
@@ -817,7 +817,7 @@ render_transform_node (GskGLRenderer *self,
}
break;
- case GSK_MATRIX_CATEGORY_2D_AFFINE:
+ case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
{
graphene_matrix_t mat;
@@ -828,9 +828,10 @@ render_transform_node (GskGLRenderer *self,
}
break;
- case GSK_MATRIX_CATEGORY_UNKNOWN:
- case GSK_MATRIX_CATEGORY_ANY:
- case GSK_MATRIX_CATEGORY_INVERTIBLE:
+ case GSK_TRANSFORM_CATEGORY_UNKNOWN:
+ case GSK_TRANSFORM_CATEGORY_ANY:
+ case GSK_TRANSFORM_CATEGORY_3D:
+ case GSK_TRANSFORM_CATEGORY_2D:
default:
{
const float min_x = child->bounds.origin.x;
@@ -1423,7 +1424,7 @@ render_outset_shadow_node (GskGLRenderer *self,
op.op = OP_CLEAR;
ops_add (builder, &op);
prev_projection = ops_set_projection (builder, &item_proj);
- ops_set_modelview (builder, &identity, GSK_MATRIX_CATEGORY_IDENTITY);
+ ops_set_modelview (builder, &identity, GSK_TRANSFORM_CATEGORY_IDENTITY);
prev_viewport = ops_set_viewport (builder, &GRAPHENE_RECT_INIT (0, 0, texture_width, texture_height));
/* Draw outline */
@@ -2640,7 +2641,7 @@ add_offscreen_ops (GskGLRenderer *self,
op.op = OP_CLEAR;
ops_add (builder, &op);
prev_projection = ops_set_projection (builder, &item_proj);
- ops_set_modelview (builder, &identity, GSK_MATRIX_CATEGORY_IDENTITY);
+ ops_set_modelview (builder, &identity, GSK_TRANSFORM_CATEGORY_IDENTITY);
prev_viewport = ops_set_viewport (builder,
&GRAPHENE_RECT_INIT (bounds->origin.x * scale,
bounds->origin.y * scale,
@@ -2901,7 +2902,7 @@ gsk_gl_renderer_do_render (GskRenderer *renderer,
render_op_builder.current_opacity = 1.0f;
render_op_builder.render_ops = self->render_ops;
ops_set_modelview (&render_op_builder, &modelview,
- scale_factor == 1 ? GSK_MATRIX_CATEGORY_IDENTITY : GSK_MATRIX_CATEGORY_2D_AFFINE);
+ scale_factor == 1 ? GSK_TRANSFORM_CATEGORY_IDENTITY : GSK_TRANSFORM_CATEGORY_2D_AFFINE);
/* Initial clip is self->render_region! */
if (self->render_region != NULL)
diff --git a/gsk/gl/gskglrenderops.c b/gsk/gl/gskglrenderops.c
index ee5e19b479..beb94a5967 100644
--- a/gsk/gl/gskglrenderops.c
+++ b/gsk/gl/gskglrenderops.c
@@ -65,22 +65,23 @@ extract_matrix_metadata (const graphene_matrix_t *m,
{
switch (md->category)
{
- case GSK_MATRIX_CATEGORY_IDENTITY:
+ case GSK_TRANSFORM_CATEGORY_IDENTITY:
md->scale_x = 1;
md->scale_y = 1;
break;
- case GSK_MATRIX_CATEGORY_2D_TRANSLATE:
+ case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
md->translate_x = graphene_matrix_get_value (m, 3, 0);
md->translate_y = graphene_matrix_get_value (m, 3, 1);
md->scale_x = 1;
md->scale_y = 1;
break;
- case GSK_MATRIX_CATEGORY_UNKNOWN:
- case GSK_MATRIX_CATEGORY_ANY:
- case GSK_MATRIX_CATEGORY_INVERTIBLE:
- case GSK_MATRIX_CATEGORY_2D_AFFINE:
+ case GSK_TRANSFORM_CATEGORY_UNKNOWN:
+ case GSK_TRANSFORM_CATEGORY_ANY:
+ case GSK_TRANSFORM_CATEGORY_3D:
+ case GSK_TRANSFORM_CATEGORY_2D:
+ case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
{
graphene_vec3_t col1;
graphene_vec3_t col2;
@@ -121,21 +122,22 @@ ops_transform_bounds_modelview (const RenderOpBuilder *builder,
switch (head->metadata.category)
{
- case GSK_MATRIX_CATEGORY_IDENTITY:
+ case GSK_TRANSFORM_CATEGORY_IDENTITY:
*dst = *src;
break;
- case GSK_MATRIX_CATEGORY_2D_TRANSLATE:
+ case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
*dst = *src;
dst->origin.x += head->metadata.translate_x;
dst->origin.y += head->metadata.translate_y;
break;
/* TODO: Handle scale */
- case GSK_MATRIX_CATEGORY_2D_AFFINE:
- case GSK_MATRIX_CATEGORY_UNKNOWN:
- case GSK_MATRIX_CATEGORY_ANY:
- case GSK_MATRIX_CATEGORY_INVERTIBLE:
+ case GSK_TRANSFORM_CATEGORY_UNKNOWN:
+ case GSK_TRANSFORM_CATEGORY_ANY:
+ case GSK_TRANSFORM_CATEGORY_3D:
+ case GSK_TRANSFORM_CATEGORY_2D:
+ case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
default:
graphene_matrix_transform_bounds (builder->current_modelview,
src,
@@ -333,7 +335,7 @@ ops_set_modelview_internal (RenderOpBuilder *builder,
void
ops_set_modelview (RenderOpBuilder *builder,
const graphene_matrix_t *mv,
- GskMatrixCategory mv_category)
+ GskTransformCategory mv_category)
{
MatrixStackEntry *entry;
@@ -363,7 +365,7 @@ ops_set_modelview (RenderOpBuilder *builder,
void
ops_push_modelview (RenderOpBuilder *builder,
const graphene_matrix_t *mv,
- GskMatrixCategory mv_category)
+ GskTransformCategory mv_category)
{
float scale = ops_get_scale (builder);
MatrixStackEntry *entry;
diff --git a/gsk/gl/gskglrenderopsprivate.h b/gsk/gl/gskglrenderopsprivate.h
index e80d688259..f54440aa30 100644
--- a/gsk/gl/gskglrenderopsprivate.h
+++ b/gsk/gl/gskglrenderopsprivate.h
@@ -25,7 +25,7 @@ typedef struct
float dx_before;
float dy_before;
- GskMatrixCategory category;
+ GskTransformCategory category;
} OpsMatrixMetadata;
typedef struct
@@ -281,10 +281,10 @@ void ops_dump_framebuffer (RenderOpBuilder *builder,
void ops_finish (RenderOpBuilder *builder);
void ops_push_modelview (RenderOpBuilder *builder,
const graphene_matrix_t *mv,
- GskMatrixCategory mv_category);
+ GskTransformCategory mv_category);
void ops_set_modelview (RenderOpBuilder *builder,
const graphene_matrix_t *mv,
- GskMatrixCategory mv_category);
+ GskTransformCategory mv_category);
void ops_pop_modelview (RenderOpBuilder *builder);
float ops_get_scale (const RenderOpBuilder *builder);
diff --git a/gsk/gskenums.h b/gsk/gskenums.h
index 795a8ed37c..aa6978cfe4 100644
--- a/gsk/gskenums.h
+++ b/gsk/gskenums.h
@@ -170,4 +170,42 @@ typedef enum {
GSK_SERIALIZATION_INVALID_DATA
} GskSerializationError;
+/**
+ * GskTransformCategory:
+ * @GSK_TRANSFORM_CATEGORY_UNKNOWN: The category of the matrix has not been
+ * determined.
+ * @GSK_TRANSFORM_CATEGORY_ANY: Analyzing the matrix concluded that it does
+ * not fit in any other category.
+ * @GSK_TRANSFORM_CATEGORY_2D: The matrix is a 3D matrix. This means that
+ * the w column (the last column) has the values (0, 0, 0, 1).
+ * @GSK_TRANSFORM_CATEGORY_2D: The matrix is a 2D matrix. This is equivalent
+ * to graphene_matrix_is_2d() returning %TRUE. In particular, this
+ * means that Cairo can deal with the matrix.
+ * @GSK_TRANSFORM_CATEGORY_2D_AFFINE: The matrix is a combination of 2D scale
+ * and 2D translation operations. In particular, this means that any
+ * rectangle can be transformed exactly using this matrix.
+ * @GSK_TRANSFORM_CATEGORY_2D_TRANSLATE: The matrix is a 2D translation.
+ * @GSK_TRANSFORM_CATEGORY_IDENTITY: The matrix is the identity matrix.
+ *
+ * The categories of matrices relevant for GSK and GTK. Note that any
+ * category includes matrices of all later categories. So if you want
+ * to for example check if a matrix is a 2D matrix,
+ * `category >= GSK_TRANSFORM_CATEGORY_2D` is the way to do this.
+ *
+ * Also keep in mind that rounding errors may cause matrices to not
+ * conform to their categories. Otherwise, matrix operations done via
+ * mutliplication will not worsen categories. So for the matrix
+ * multiplication `C = A * B`, `category(C) = MIN (category(A), category(B))`.
+ */
+typedef enum
+{
+ GSK_TRANSFORM_CATEGORY_UNKNOWN,
+ GSK_TRANSFORM_CATEGORY_ANY,
+ GSK_TRANSFORM_CATEGORY_3D,
+ GSK_TRANSFORM_CATEGORY_2D,
+ GSK_TRANSFORM_CATEGORY_2D_AFFINE,
+ GSK_TRANSFORM_CATEGORY_2D_TRANSLATE,
+ GSK_TRANSFORM_CATEGORY_IDENTITY
+} GskTransformCategory;
+
#endif /* __GSK_TYPES_H__ */
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index 0066a37072..11cb612a87 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -2441,7 +2441,7 @@ gsk_transform_node_serialize (GskRenderNode *node)
graphene_matrix_to_float (&matrix, mat);
return g_variant_new (GSK_TRANSFORM_NODE_VARIANT_TYPE,
- gsk_transform_categorize (self->transform),
+ gsk_transform_get_category (self->transform),
(double) mat[0], (double) mat[1], (double) mat[2], (double) mat[3],
(double) mat[4], (double) mat[5], (double) mat[6], (double) mat[7],
(double) mat[8], (double) mat[9], (double) mat[10], (double) mat[11],
diff --git a/gsk/gskrendernodeprivate.h b/gsk/gskrendernodeprivate.h
index 744e96cd97..df47602526 100644
--- a/gsk/gskrendernodeprivate.h
+++ b/gsk/gskrendernodeprivate.h
@@ -6,44 +6,6 @@
G_BEGIN_DECLS
-/*<private>
- * GskMatrixCategory:
- * @GSK_MATRIX_CATEGORY_UNKNOWN: The category of the matrix has not been
- * determined.
- * @GSK_MATRIX_CATEGORY_ANY: Analyzing the matrix concluded that it does
- * not fit in any other category.
- * @GSK_MATRIX_CATEGORY_INVERTIBLE: The matrix is linear independant and
- * should therefor be invertible. Note that this is not guaranteed
- * to actually be true due to rounding errors when inverting.
- * @GSK_MATRIX_CATEGORY_2D: The matrix is a 2D matrix. This is equivalent
- * to graphene_matrix_is_2d() returning %TRUE. In particular, this
- * means that Cairo can deal with the matrix.
- * @GSK_MATRIX_CATEGORY_2D_AFFINE: The matrix is a combination of 2D scale
- * and 2D translation operations. In particular, this means that any
- * rectangle can be transformed exactly using this matrix.
- * @GSK_MATRIX_CATEGORY_2D_TRANSLATE: The matrix is a 2D translation.
- * @GSK_MATRIX_CATEGORY_IDENTITY: The matrix is the identity matrix.
- *
- * The categories of matrices relevant for GSK and GTK. Note that any
- * category includes matrices of all later categories. So if you want
- * to for example check if a matrix is a 2D matrix,
- * `category >= GSK_MATRIX_CATEGORY_2D` is the way to do this.
- *
- * Also keep in mind that rounding errors may cause matrices to not
- * conform to their categories. Otherwise, matrix operations done via
- * mutliplication will not worsen categories. So for the matrix
- * multiplication `C = A * B`, `category(C) = MIN (category(A), category(B))`.
- */
-typedef enum
-{
- GSK_MATRIX_CATEGORY_UNKNOWN,
- GSK_MATRIX_CATEGORY_ANY,
- GSK_MATRIX_CATEGORY_INVERTIBLE,
- GSK_MATRIX_CATEGORY_2D_AFFINE,
- GSK_MATRIX_CATEGORY_2D_TRANSLATE,
- GSK_MATRIX_CATEGORY_IDENTITY
-} GskMatrixCategory;
-
typedef struct _GskRenderNodeClass GskRenderNodeClass;
#define GSK_IS_RENDER_NODE_TYPE(node,type) (GSK_IS_RENDER_NODE (node) && (node)->node_class->node_type ==
(type))
diff --git a/gsk/gsktransform.c b/gsk/gsktransform.c
index 555af72294..6ec0541aa7 100644
--- a/gsk/gsktransform.c
+++ b/gsk/gsktransform.c
@@ -53,7 +53,7 @@ struct _GskTransformClass
const char *type_name;
void (* finalize) (GskTransform *transform);
- GskMatrixCategory (* categorize) (GskTransform *transform);
+ GskTransformCategory (* categorize) (GskTransform *transform);
void (* to_matrix) (GskTransform *transform,
graphene_matrix_t *out_matrix);
gboolean (* apply_2d) (GskTransform *transform,
@@ -124,10 +124,10 @@ gsk_identity_transform_finalize (GskTransform *transform)
{
}
-static GskMatrixCategory
+static GskTransformCategory
gsk_identity_transform_categorize (GskTransform *transform)
{
- return GSK_MATRIX_CATEGORY_IDENTITY;
+ return GSK_TRANSFORM_CATEGORY_IDENTITY;
}
static void
@@ -254,7 +254,7 @@ struct _GskMatrixTransform
GskTransform parent;
graphene_matrix_t matrix;
- GskMatrixCategory category;
+ GskTransformCategory category;
};
static void
@@ -262,7 +262,7 @@ gsk_matrix_transform_finalize (GskTransform *self)
{
}
-static GskMatrixCategory
+static GskTransformCategory
gsk_matrix_transform_categorize (GskTransform *transform)
{
GskMatrixTransform *self = (GskMatrixTransform *) transform;
@@ -302,25 +302,26 @@ gsk_matrix_transform_apply_affine (GskTransform *transform,
switch (self->category)
{
- case GSK_MATRIX_CATEGORY_UNKNOWN:
- case GSK_MATRIX_CATEGORY_ANY:
- case GSK_MATRIX_CATEGORY_INVERTIBLE:
+ case GSK_TRANSFORM_CATEGORY_UNKNOWN:
+ case GSK_TRANSFORM_CATEGORY_ANY:
+ case GSK_TRANSFORM_CATEGORY_3D:
+ case GSK_TRANSFORM_CATEGORY_2D:
default:
return FALSE;
- case GSK_MATRIX_CATEGORY_2D_AFFINE:
+ case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
*out_dx += *out_scale_x * graphene_matrix_get_value (&self->matrix, 3, 0);
*out_dy += *out_scale_y * graphene_matrix_get_value (&self->matrix, 3, 1);
*out_scale_x *= graphene_matrix_get_value (&self->matrix, 0, 0);
*out_scale_y *= graphene_matrix_get_value (&self->matrix, 1, 1);
return TRUE;
- case GSK_MATRIX_CATEGORY_2D_TRANSLATE:
+ case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
*out_dx += *out_scale_x * graphene_matrix_get_value (&self->matrix, 3, 0);
*out_dy += *out_scale_y * graphene_matrix_get_value (&self->matrix, 3, 1);
return TRUE;
- case GSK_MATRIX_CATEGORY_IDENTITY:
+ case GSK_TRANSFORM_CATEGORY_IDENTITY:
return TRUE;
}
}
@@ -334,19 +335,20 @@ gsk_matrix_transform_apply_translate (GskTransform *transform,
switch (self->category)
{
- case GSK_MATRIX_CATEGORY_UNKNOWN:
- case GSK_MATRIX_CATEGORY_ANY:
- case GSK_MATRIX_CATEGORY_INVERTIBLE:
- case GSK_MATRIX_CATEGORY_2D_AFFINE:
+ case GSK_TRANSFORM_CATEGORY_UNKNOWN:
+ case GSK_TRANSFORM_CATEGORY_ANY:
+ case GSK_TRANSFORM_CATEGORY_3D:
+ case GSK_TRANSFORM_CATEGORY_2D:
+ case GSK_TRANSFORM_CATEGORY_2D_AFFINE:
default:
return FALSE;
- case GSK_MATRIX_CATEGORY_2D_TRANSLATE:
+ case GSK_TRANSFORM_CATEGORY_2D_TRANSLATE:
*out_dx += graphene_matrix_get_value (&self->matrix, 3, 0);
*out_dy += graphene_matrix_get_value (&self->matrix, 3, 1);
return TRUE;
- case GSK_MATRIX_CATEGORY_IDENTITY:
+ case GSK_TRANSFORM_CATEGORY_IDENTITY:
return TRUE;
}
return TRUE;
@@ -421,7 +423,7 @@ static const GskTransformClass GSK_TRANSFORM_TRANSFORM_CLASS =
GskTransform *
gsk_transform_matrix_with_category (GskTransform *next,
const graphene_matrix_t *matrix,
- GskMatrixCategory category)
+ GskTransformCategory category)
{
GskMatrixTransform *result = gsk_transform_alloc (&GSK_TRANSFORM_TRANSFORM_CLASS, next);
@@ -444,7 +446,7 @@ GskTransform *
gsk_transform_matrix (GskTransform *next,
const graphene_matrix_t *matrix)
{
- return gsk_transform_matrix_with_category (next, matrix, GSK_MATRIX_CATEGORY_UNKNOWN);
+ return gsk_transform_matrix_with_category (next, matrix, GSK_TRANSFORM_CATEGORY_UNKNOWN);
}
/*** TRANSLATE ***/
@@ -463,15 +465,15 @@ gsk_translate_transform_finalize (GskTransform *self)
{
}
-static GskMatrixCategory
+static GskTransformCategory
gsk_translate_transform_categorize (GskTransform *transform)
{
GskTranslateTransform *self = (GskTranslateTransform *) transform;
if (self->point.z != 0.0)
- return GSK_MATRIX_CATEGORY_INVERTIBLE;
+ return GSK_TRANSFORM_CATEGORY_3D;
- return GSK_MATRIX_CATEGORY_2D_TRANSLATE;
+ return GSK_TRANSFORM_CATEGORY_2D_TRANSLATE;
}
static void
@@ -650,10 +652,10 @@ gsk_rotate_transform_finalize (GskTransform *self)
{
}
-static GskMatrixCategory
+static GskTransformCategory
gsk_rotate_transform_categorize (GskTransform *transform)
{
- return GSK_MATRIX_CATEGORY_INVERTIBLE;
+ return GSK_TRANSFORM_CATEGORY_3D;
}
static void
@@ -821,15 +823,15 @@ gsk_scale_transform_finalize (GskTransform *self)
{
}
-static GskMatrixCategory
+static GskTransformCategory
gsk_scale_transform_categorize (GskTransform *transform)
{
GskScaleTransform *self = (GskScaleTransform *) transform;
if (self->factor_z != 1.0)
- return GSK_MATRIX_CATEGORY_INVERTIBLE;
+ return GSK_TRANSFORM_CATEGORY_3D;
- return GSK_MATRIX_CATEGORY_2D_AFFINE;
+ return GSK_TRANSFORM_CATEGORY_2D_AFFINE;
}
static void
@@ -1315,21 +1317,21 @@ gsk_transform_equal (GskTransform *first,
return first->transform_class->equal (first, second);
}
-/*<private>
- * gsk_transform_categorize:
- * @self: (allow-none): A matrix
- *
+/**
+ * gsk_transform_get_category:
+ * @self: (allow-none): A #GskTransform
*
+ * Returns the category this transform belongs to.
*
- * Returns: The category this matrix belongs to
+ * Returns: The category of the transform
**/
-GskMatrixCategory
-gsk_transform_categorize (GskTransform *self)
+GskTransformCategory
+gsk_transform_get_category (GskTransform *self)
{
if (self == NULL)
- return GSK_MATRIX_CATEGORY_IDENTITY;
+ return GSK_TRANSFORM_CATEGORY_IDENTITY;
- return MIN (gsk_transform_categorize (self->next),
+ return MIN (gsk_transform_get_category (self->next),
self->transform_class->categorize (self));
}
diff --git a/gsk/gsktransform.h b/gsk/gsktransform.h
index 78aeb55975..f58993026a 100644
--- a/gsk/gsktransform.h
+++ b/gsk/gsktransform.h
@@ -25,6 +25,7 @@
#error "Only <gsk/gsk.h> can be included directly."
#endif
+#include <gsk/gskenums.h>
#include <gsk/gsktypes.h>
G_BEGIN_DECLS
@@ -66,6 +67,8 @@ gboolean gsk_transform_to_translate (GskTransform
float *out_dx,
float *out_dy)
G_GNUC_WARN_UNUSED_RESULT;
+GDK_AVAILABLE_IN_ALL
+GskTransformCategory gsk_transform_get_category (GskTransform *self);
GDK_AVAILABLE_IN_ALL
gboolean gsk_transform_equal (GskTransform *first,
GskTransform *second)
G_GNUC_PURE;
diff --git a/gsk/gsktransformprivate.h b/gsk/gsktransformprivate.h
index 0aba516f25..5ea45e03fb 100644
--- a/gsk/gsktransformprivate.h
+++ b/gsk/gsktransformprivate.h
@@ -28,11 +28,9 @@
G_BEGIN_DECLS
-GskMatrixCategory gsk_transform_categorize (GskTransform *self);
-
GskTransform * gsk_transform_matrix_with_category (GskTransform *next,
const graphene_matrix_t*matrix,
- GskMatrixCategory category);
+ GskTransformCategory category);
G_END_DECLS
diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c
index 191810562e..1a85e0c697 100644
--- a/gtk/gtksnapshot.c
+++ b/gtk/gtksnapshot.c
@@ -1270,7 +1270,7 @@ gtk_snapshot_transform_matrix (GtkSnapshot *snapshot,
void
gtk_snapshot_transform_matrix_with_category (GtkSnapshot *snapshot,
const graphene_matrix_t *matrix,
- GskMatrixCategory category)
+ GskTransformCategory category)
{
GtkSnapshotState *state;
diff --git a/gtk/gtksnapshotprivate.h b/gtk/gtksnapshotprivate.h
index 536c7c08cf..d5ae52ba51 100644
--- a/gtk/gtksnapshotprivate.h
+++ b/gtk/gtksnapshotprivate.h
@@ -104,7 +104,7 @@ GtkSnapshot * gtk_snapshot_new_with_parent (GtkSnapshot
void gtk_snapshot_transform_matrix_with_category
(GtkSnapshot *snapshot,
const graphene_matrix_t*matrix,
- GskMatrixCategory category);
+ GskTransformCategory category);
void gtk_snapshot_append_text (GtkSnapshot *snapshot,
PangoFont *font,
PangoGlyphString *glyphs,
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 3fd41b2c5e..9a672d65c0 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4327,9 +4327,9 @@ gtk_widget_allocate (GtkWidget *widget,
graphene_matrix_init_translate (&priv->transform, &GRAPHENE_POINT3D_INIT (adjusted.x, adjusted.y, 0));
gsk_transform_to_matrix (transform, &transform_matrix);
graphene_matrix_multiply (&priv->transform, &transform_matrix, &priv->transform);
- priv->transform_category = gsk_transform_categorize (transform);
+ priv->transform_category = gsk_transform_get_category (transform);
if (adjusted.x || adjusted.y)
- priv->transform_category = MIN (priv->transform_category, GSK_MATRIX_CATEGORY_2D_TRANSLATE);
+ priv->transform_category = MIN (priv->transform_category, GSK_TRANSFORM_CATEGORY_2D_TRANSLATE);
if (!alloc_needed && !size_changed && !baseline_changed)
{
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 569268ae2b..c8b872d8db 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -150,7 +150,7 @@ struct _GtkWidgetPrivate
gint allocated_size_baseline;
graphene_matrix_t transform;
- GskMatrixCategory transform_category;
+ GskTransformCategory transform_category;
int width;
int height;
int baseline;
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
index ff6b40911b..788d96d72a 100644
--- a/gtk/inspector/recorder.c
+++ b/gtk/inspector/recorder.c
@@ -890,12 +890,13 @@ populate_render_node_properties (GtkListStore *store,
case GSK_TRANSFORM_NODE:
{
static const char * category_names[] = {
- [GSK_MATRIX_CATEGORY_UNKNOWN] = "unknown",
- [GSK_MATRIX_CATEGORY_ANY] = "any",
- [GSK_MATRIX_CATEGORY_INVERTIBLE] = "invertible",
- [GSK_MATRIX_CATEGORY_2D_AFFINE] = "2D affine",
- [GSK_MATRIX_CATEGORY_2D_TRANSLATE] = "2D transform",
- [GSK_MATRIX_CATEGORY_IDENTITY] = "identity"
+ [GSK_TRANSFORM_CATEGORY_UNKNOWN] = "unknown",
+ [GSK_TRANSFORM_CATEGORY_ANY] = "any",
+ [GSK_TRANSFORM_CATEGORY_3D] = "3D",
+ [GSK_TRANSFORM_CATEGORY_2D] = "2D",
+ [GSK_TRANSFORM_CATEGORY_2D_AFFINE] = "2D affine",
+ [GSK_TRANSFORM_CATEGORY_2D_TRANSLATE] = "2D translate",
+ [GSK_TRANSFORM_CATEGORY_IDENTITY] = "identity"
};
GskTransform *transform;
char *s;
@@ -904,7 +905,7 @@ populate_render_node_properties (GtkListStore *store,
s = gsk_transform_to_string (transform);
add_text_row (store, "Matrix", s);
g_free (s);
- add_text_row (store, "Category", category_names[gsk_transform_categorize (transform)]);
+ add_text_row (store, "Category", category_names[gsk_transform_get_category (transform)]);
}
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]