1
0
Fork 0

cogl: Move TextureVertex to Clutter

The type is only used in ClutterDeformEffect, so move it there

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3895>
This commit is contained in:
Bilal Elmoussaoui 2024-07-22 11:33:44 +02:00
parent fb3f239953
commit 138e5d4f54
4 changed files with 39 additions and 53 deletions

View file

@ -100,10 +100,10 @@ G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterDeformEffect,
CLUTTER_TYPE_OFFSCREEN_EFFECT)
static void
clutter_deform_effect_real_deform_vertex (ClutterDeformEffect *effect,
gfloat width,
gfloat height,
CoglTextureVertex *vertex)
clutter_deform_effect_real_deform_vertex (ClutterDeformEffect *effect,
gfloat width,
gfloat height,
ClutterTextureVertex *vertex)
{
g_warning ("%s: Deformation effect of type '%s' does not implement "
"the required ClutterDeformEffect::deform_vertex virtual "
@ -113,10 +113,10 @@ clutter_deform_effect_real_deform_vertex (ClutterDeformEffect *effect,
}
static void
clutter_deform_effect_deform_vertex (ClutterDeformEffect *effect,
gfloat width,
gfloat height,
CoglTextureVertex *vertex)
clutter_deform_effect_deform_vertex (ClutterDeformEffect *effect,
gfloat width,
gfloat height,
ClutterTextureVertex *vertex)
{
CLUTTER_DEFORM_EFFECT_GET_CLASS (effect)->deform_vertex (effect,
width, height,
@ -218,7 +218,7 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect,
for (j = 0; j < priv->x_tiles + 1; j++)
{
CoglVertexP3T2C4 *vertex_out;
CoglTextureVertex vertex;
ClutterTextureVertex vertex;
/* CoglTextureVertex isn't an ideal structure to use for
this because it contains a CoglColor. The internal

View file

@ -35,6 +35,28 @@ G_BEGIN_DECLS
#define CLUTTER_TYPE_DEFORM_EFFECT (clutter_deform_effect_get_type ())
/**
* ClutterTextureVertex:
* @x: Model x-coordinate
* @y: Model y-coordinate
* @z: Model z-coordinate
* @tx: Texture x-coordinate
* @ty: Texture y-coordinate
* @color: The color to use at this vertex. This is ignored if
* use_color is %FALSE when calling cogl_polygon()
*
* Used to specify vertex information when calling cogl_polygon()
*/
typedef struct _ClutterTextureVertex
{
float x, y, z;
float tx, ty;
CoglColor color;
} ClutterTextureVertex;
G_STATIC_ASSERT (sizeof (ClutterTextureVertex) == 24);
CLUTTER_EXPORT
G_DECLARE_DERIVABLE_TYPE (ClutterDeformEffect,
clutter_deform_effect,
@ -56,10 +78,10 @@ struct _ClutterDeformEffectClass
ClutterOffscreenEffectClass parent_class;
/*< public >*/
void (* deform_vertex) (ClutterDeformEffect *effect,
gfloat width,
gfloat height,
CoglTextureVertex *vertex);
void (* deform_vertex) (ClutterDeformEffect *effect,
gfloat width,
gfloat height,
ClutterTextureVertex *vertex);
};
CLUTTER_EXPORT

View file

@ -70,10 +70,10 @@ G_DEFINE_TYPE (ClutterPageTurnEffect,
CLUTTER_TYPE_DEFORM_EFFECT);
static void
clutter_page_turn_effect_deform_vertex (ClutterDeformEffect *effect,
gfloat width,
gfloat height,
CoglTextureVertex *vertex)
clutter_page_turn_effect_deform_vertex (ClutterDeformEffect *effect,
gfloat width,
gfloat height,
ClutterTextureVertex *vertex)
{
ClutterPageTurnEffect *self = CLUTTER_PAGE_TURN_EFFECT (effect);
gfloat cx, cy, rx, ry, radians, turn_angle;

View file

@ -56,24 +56,9 @@ G_BEGIN_DECLS
#define COGL_PRIVATE(x) private_member_ ## x
#endif
#ifndef __GI_SCANNER__
/* To help catch accidental changes to public structs that should
* be stack allocated we use this macro to compile time assert that
* a struct size is as expected.
*/
#define COGL_STRUCT_SIZE_ASSERT(TYPE, SIZE) \
typedef struct { \
char compile_time_assert_ ## TYPE ## _size[ \
(sizeof (TYPE) == (SIZE)) ? 1 : -1]; \
} _ ## TYPE ## SizeCheck
#else
#define COGL_STRUCT_SIZE_ASSERT(TYPE, SIZE)
#endif
typedef struct _CoglFramebuffer CoglFramebuffer;
typedef struct _CoglColor CoglColor;
typedef struct _CoglTextureVertex CoglTextureVertex;
/**
* CoglDmaBufHandle: (free-func cogl_dma_buf_handle_free)
@ -101,27 +86,6 @@ struct _CoglColor
uint8_t alpha;
};
/**
* CoglTextureVertex:
* @x: Model x-coordinate
* @y: Model y-coordinate
* @z: Model z-coordinate
* @tx: Texture x-coordinate
* @ty: Texture y-coordinate
* @color: The color to use at this vertex. This is ignored if
* use_color is %FALSE when calling cogl_polygon()
*
* Used to specify vertex information when calling cogl_polygon()
*/
struct _CoglTextureVertex
{
float x, y, z;
float tx, ty;
CoglColor color;
};
COGL_STRUCT_SIZE_ASSERT (CoglTextureVertex, 24);
/**
* COGL_BLEND_STRING_ERROR:
*