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:
@ -103,7 +103,7 @@ static void
|
|||||||
clutter_deform_effect_real_deform_vertex (ClutterDeformEffect *effect,
|
clutter_deform_effect_real_deform_vertex (ClutterDeformEffect *effect,
|
||||||
gfloat width,
|
gfloat width,
|
||||||
gfloat height,
|
gfloat height,
|
||||||
CoglTextureVertex *vertex)
|
ClutterTextureVertex *vertex)
|
||||||
{
|
{
|
||||||
g_warning ("%s: Deformation effect of type '%s' does not implement "
|
g_warning ("%s: Deformation effect of type '%s' does not implement "
|
||||||
"the required ClutterDeformEffect::deform_vertex virtual "
|
"the required ClutterDeformEffect::deform_vertex virtual "
|
||||||
@ -116,7 +116,7 @@ static void
|
|||||||
clutter_deform_effect_deform_vertex (ClutterDeformEffect *effect,
|
clutter_deform_effect_deform_vertex (ClutterDeformEffect *effect,
|
||||||
gfloat width,
|
gfloat width,
|
||||||
gfloat height,
|
gfloat height,
|
||||||
CoglTextureVertex *vertex)
|
ClutterTextureVertex *vertex)
|
||||||
{
|
{
|
||||||
CLUTTER_DEFORM_EFFECT_GET_CLASS (effect)->deform_vertex (effect,
|
CLUTTER_DEFORM_EFFECT_GET_CLASS (effect)->deform_vertex (effect,
|
||||||
width, height,
|
width, height,
|
||||||
@ -218,7 +218,7 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect,
|
|||||||
for (j = 0; j < priv->x_tiles + 1; j++)
|
for (j = 0; j < priv->x_tiles + 1; j++)
|
||||||
{
|
{
|
||||||
CoglVertexP3T2C4 *vertex_out;
|
CoglVertexP3T2C4 *vertex_out;
|
||||||
CoglTextureVertex vertex;
|
ClutterTextureVertex vertex;
|
||||||
|
|
||||||
/* CoglTextureVertex isn't an ideal structure to use for
|
/* CoglTextureVertex isn't an ideal structure to use for
|
||||||
this because it contains a CoglColor. The internal
|
this because it contains a CoglColor. The internal
|
||||||
|
@ -35,6 +35,28 @@ G_BEGIN_DECLS
|
|||||||
|
|
||||||
#define CLUTTER_TYPE_DEFORM_EFFECT (clutter_deform_effect_get_type ())
|
#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
|
CLUTTER_EXPORT
|
||||||
G_DECLARE_DERIVABLE_TYPE (ClutterDeformEffect,
|
G_DECLARE_DERIVABLE_TYPE (ClutterDeformEffect,
|
||||||
clutter_deform_effect,
|
clutter_deform_effect,
|
||||||
@ -59,7 +81,7 @@ struct _ClutterDeformEffectClass
|
|||||||
void (* deform_vertex) (ClutterDeformEffect *effect,
|
void (* deform_vertex) (ClutterDeformEffect *effect,
|
||||||
gfloat width,
|
gfloat width,
|
||||||
gfloat height,
|
gfloat height,
|
||||||
CoglTextureVertex *vertex);
|
ClutterTextureVertex *vertex);
|
||||||
};
|
};
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
@ -73,7 +73,7 @@ static void
|
|||||||
clutter_page_turn_effect_deform_vertex (ClutterDeformEffect *effect,
|
clutter_page_turn_effect_deform_vertex (ClutterDeformEffect *effect,
|
||||||
gfloat width,
|
gfloat width,
|
||||||
gfloat height,
|
gfloat height,
|
||||||
CoglTextureVertex *vertex)
|
ClutterTextureVertex *vertex)
|
||||||
{
|
{
|
||||||
ClutterPageTurnEffect *self = CLUTTER_PAGE_TURN_EFFECT (effect);
|
ClutterPageTurnEffect *self = CLUTTER_PAGE_TURN_EFFECT (effect);
|
||||||
gfloat cx, cy, rx, ry, radians, turn_angle;
|
gfloat cx, cy, rx, ry, radians, turn_angle;
|
||||||
|
@ -56,24 +56,9 @@ G_BEGIN_DECLS
|
|||||||
#define COGL_PRIVATE(x) private_member_ ## x
|
#define COGL_PRIVATE(x) private_member_ ## x
|
||||||
#endif
|
#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 _CoglFramebuffer CoglFramebuffer;
|
||||||
|
|
||||||
typedef struct _CoglColor CoglColor;
|
typedef struct _CoglColor CoglColor;
|
||||||
typedef struct _CoglTextureVertex CoglTextureVertex;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CoglDmaBufHandle: (free-func cogl_dma_buf_handle_free)
|
* CoglDmaBufHandle: (free-func cogl_dma_buf_handle_free)
|
||||||
@ -101,27 +86,6 @@ struct _CoglColor
|
|||||||
uint8_t alpha;
|
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:
|
* COGL_BLEND_STRING_ERROR:
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user