mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-10 12:40:10 +00:00
transform: Move gsk_transform_dihedral
This is a transform function, so put it in gsktransform.c.
This commit is contained in:
parent
305fad9a24
commit
ec9b2e531b
@ -1431,22 +1431,6 @@ gsk_gpu_node_processor_add_first_rounded_clip_node (GskGpuNodeProcessor *self,
|
||||
gsk_rounded_clip_node_get_child (node));
|
||||
}
|
||||
|
||||
static GskTransform *
|
||||
gsk_transform_dihedral (GskTransform *transform,
|
||||
GdkDihedral dihedral)
|
||||
{
|
||||
int rotate = dihedral & 3;
|
||||
int flip = dihedral & 4;
|
||||
|
||||
if (flip)
|
||||
transform = gsk_transform_scale (transform, -1.0, 1.0);
|
||||
|
||||
if (rotate)
|
||||
transform = gsk_transform_rotate (transform, rotate * 90.0f);
|
||||
|
||||
return transform;
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_gpu_node_processor_add_transform_node (GskGpuNodeProcessor *self,
|
||||
GskRenderNode *node)
|
||||
|
@ -2109,6 +2109,34 @@ gsk_transform_to_dihedral (GskTransform *self,
|
||||
out_dx, out_dy);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gsk_transform_dihedral:
|
||||
* @next: (nullable) (transfer full): the next transform
|
||||
* @dihedral: dihedral tansform to apply
|
||||
*
|
||||
* Applies a dihedral transform to @next.
|
||||
*
|
||||
* This function consumes @next. Use [method@Gsk.Transform.ref] first
|
||||
* if you want to keep it around.
|
||||
*
|
||||
* Returns: (nullable): The new transform
|
||||
**/
|
||||
GskTransform *
|
||||
gsk_transform_dihedral (GskTransform *next,
|
||||
GdkDihedral dihedral)
|
||||
{
|
||||
int rotate = dihedral & 3;
|
||||
int flip = dihedral & 4;
|
||||
|
||||
if (flip)
|
||||
next = gsk_transform_scale (next, -1.0, 1.0);
|
||||
|
||||
if (rotate)
|
||||
next = gsk_transform_rotate (next, rotate * 90.0f);
|
||||
|
||||
return next;
|
||||
}
|
||||
|
||||
/**
|
||||
* gsk_transform_to_translate:
|
||||
* @self: a `GskTransform`
|
||||
|
@ -97,6 +97,9 @@ void gsk_transform_to_dihedral (GskTransform
|
||||
float *out_dx,
|
||||
float *out_dy);
|
||||
|
||||
GskTransform * gsk_transform_dihedral (GskTransform * next,
|
||||
GdkDihedral dihedral);
|
||||
|
||||
void gsk_matrix_transform_point (const graphene_matrix_t *m,
|
||||
const graphene_point_t *p,
|
||||
graphene_point_t *res);
|
||||
|
Loading…
Reference in New Issue
Block a user