1
0
Fork 0

Rename remaining usages of material to pipeline

material is almost no longer used in the code base and the
few remaining references makes it confusing when looking at parts
of the codebase. So rename the rest as well.

Note that this renames a DeformEffect property and the only extension
making use of it doesn't use the property so i think it is okay to do
so without deprecating the old property for a few releases

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
This commit is contained in:
Bilal Elmoussaoui 2024-07-27 00:21:06 +02:00 committed by Marge Bot
parent a107cae976
commit 0f405e9270
15 changed files with 51 additions and 54 deletions

View file

@ -106,7 +106,7 @@ enum
PROP_X_TILES,
PROP_Y_TILES,
PROP_BACK_MATERIAL,
PROP_BACK_PIPELINE,
PROP_LAST
};
@ -298,7 +298,7 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect,
cogl_depth_state_set_test_function (&depth_state, COGL_DEPTH_TEST_FUNCTION_LEQUAL);
cogl_pipeline_set_depth_state (pipeline, &depth_state, NULL);
/* enable backface culling if we have a back material */
/* enable backface culling if we have a back pipeline */
if (priv->back_pipeline != NULL)
cogl_pipeline_set_cull_face_mode (pipeline,
COGL_PIPELINE_CULL_FACE_MODE_BACK);
@ -322,7 +322,7 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect,
ClutterPaintNode *back_node;
CoglPipeline *back_pipeline;
/* We probably shouldn't be modifying the user's material so
/* We probably shouldn't be modifying the user's pipeline so
instead we make a temporary copy */
back_pipeline = cogl_pipeline_copy (priv->back_pipeline);
cogl_pipeline_set_depth_state (back_pipeline, &depth_state, NULL);
@ -548,8 +548,8 @@ clutter_deform_effect_set_property (GObject *gobject,
g_value_get_uint (value));
break;
case PROP_BACK_MATERIAL:
clutter_deform_effect_set_back_material (self, g_value_get_object (value));
case PROP_BACK_PIPELINE:
clutter_deform_effect_set_back_pipeline (self, g_value_get_object (value));
break;
default:
@ -578,7 +578,7 @@ clutter_deform_effect_get_property (GObject *gobject,
g_value_set_uint (value, priv->y_tiles);
break;
case PROP_BACK_MATERIAL:
case PROP_BACK_PIPELINE:
g_value_set_object (value, priv->back_pipeline);
break;
@ -624,15 +624,15 @@ clutter_deform_effect_class_init (ClutterDeformEffectClass *klass)
G_PARAM_STATIC_STRINGS);
/**
* ClutterDeformEffect:back-material:
* ClutterDeformEffect:back-pipeline:
*
* A material to be used when painting the back of the actor
* A pipeline to be used when painting the back of the actor
* to which this effect has been applied
*
* By default, no material will be used
* By default, no pipeline will be used
*/
obj_props[PROP_BACK_MATERIAL] =
g_param_spec_object ("back-material", NULL, NULL,
obj_props[PROP_BACK_PIPELINE] =
g_param_spec_object ("back-pipeline", NULL, NULL,
COGL_TYPE_PIPELINE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
@ -662,18 +662,18 @@ clutter_deform_effect_init (ClutterDeformEffect *self)
}
/**
* clutter_deform_effect_set_back_material:
* clutter_deform_effect_set_back_pipeline:
* @effect: a #ClutterDeformEffect
* @material: (allow-none): a handle to a Cogl material
* @pipeline: (allow-none): A #CoglPipeline
*
* Sets the material that should be used when drawing the back face
* Sets the pipeline that should be used when drawing the back face
* of the actor during a deformation
*
* The #ClutterDeformEffect will take a reference on the material's
* The #ClutterDeformEffect will take a reference on the pipeline's
* handle
*/
void
clutter_deform_effect_set_back_material (ClutterDeformEffect *effect,
clutter_deform_effect_set_back_pipeline (ClutterDeformEffect *effect,
CoglPipeline *pipeline)
{
ClutterDeformEffectPrivate *priv;
@ -693,17 +693,15 @@ clutter_deform_effect_set_back_material (ClutterDeformEffect *effect,
}
/**
* clutter_deform_effect_get_back_material:
* clutter_deform_effect_get_back_pipeline:
* @effect: a #ClutterDeformEffect
*
* Retrieves the handle to the back face material used by @effect
* Retrieves the back pipeline used by @effect
*
* Return value: (transfer none): a handle for the material, or %NULL.
* The returned material is owned by the #ClutterDeformEffect and it
* should not be freed directly
* Return value: (transfer none) (nullable): A #CoglPipeline.
*/
CoglPipeline*
clutter_deform_effect_get_back_material (ClutterDeformEffect *effect)
clutter_deform_effect_get_back_pipeline (ClutterDeformEffect *effect)
{
ClutterDeformEffectPrivate *priv;

View file

@ -88,10 +88,10 @@ struct _ClutterDeformEffectClass
};
CLUTTER_EXPORT
void clutter_deform_effect_set_back_material (ClutterDeformEffect *effect,
CoglPipeline *material);
void clutter_deform_effect_set_back_pipeline (ClutterDeformEffect *effect,
CoglPipeline *pipeline);
CLUTTER_EXPORT
CoglPipeline* clutter_deform_effect_get_back_material (ClutterDeformEffect *effect);
CoglPipeline* clutter_deform_effect_get_back_pipeline (ClutterDeformEffect *effect);
CLUTTER_EXPORT
void clutter_deform_effect_set_n_tiles (ClutterDeformEffect *effect,
guint x_tiles,

View file

@ -75,10 +75,10 @@
* The example below creates two rectangles: one will be painted "behind" the actor,
* while another will be painted "on top" of the actor.
*
* The #ClutterActorMetaClass.set_actor() implementation will create the two materials
* The #ClutterActorMetaClass.set_actor() implementation will create the two pipelines
* used for the two different rectangles; the #ClutterEffectClass.paint() implementation
* will paint the first material using cogl_rectangle(), before continuing and then it
* will paint paint the second material after.
* will paint the first pipeline using cogl_rectangle(), before continuing and then it
* will paint paint the second pipeline after.
*
* ```c
* typedef struct {
@ -119,12 +119,12 @@
* if (self->actor == NULL)
* return;
*
* // Create a red material
* // Create a red pipeline
* self->rect_1 = cogl_pipeline_new ();
* cogl_color_init_from_4f (&color, 1.0, 1.0, 1.0, 1.0);
* cogl_pipeline_set_color (self->rect_1, &color);
*
* // Create a green material
* // Create a green pipeline
* self->rect_2 = cogl_pipeline_new ();
* cogl_color_init_from_4f (&color, 0.0, 1.0, 0.0, 1.0);
* cogl_pipeline_set_color (self->rect_2, &color);

View file

@ -52,7 +52,7 @@
* function, which encapsulates the effective painting of the texture that
* contains the result of the offscreen redirection.
*
* The size of the target material is defined to be as big as the
* The size of the target pipeline is defined to be as big as the
* transformed size of the [class@Actor] using the offscreen effect.
* Sub-classes of #ClutterOffscreenEffect can change the texture creation
* code to provide bigger textures by overriding the
@ -486,7 +486,7 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect,
node = transform_node;
}
/* paint the target material; this is virtualized for
/* paint the target pipeline; this is virtualized for
* sub-classes that require special hand-holding
*/
clutter_offscreen_effect_paint_target (effect, node, paint_context);
@ -640,7 +640,7 @@ clutter_offscreen_effect_init (ClutterOffscreenEffect *self)
* implementation should update any references to the texture after
* chaining-up to the parent's pre_paint implementation. This can be
* used instead of [method@OffscreenEffect.get_texture] when the
* effect subclass wants to paint using its own material.
* effect subclass wants to paint using its own pipeline.
*
* Return value: (transfer none): a #CoglTexture or %NULL. The
* returned texture is owned by Clutter and it should not be

View file

@ -134,7 +134,7 @@ get_base_texture_alpha_pipeline (CoglPangoPipelineCache *cache)
cogl_pipeline_set_static_name (pipeline, "CoglPango (texture alpha)");
cache->base_texture_alpha_pipeline = pipeline;
/* The default combine mode of materials is to modulate (A x B)
/* The default combine mode of pipelines is to modulate (A x B)
* the texture RGBA channels with the RGBA channels of the
* previous layer (which in our case is just the font color)
*

View file

@ -301,7 +301,7 @@ validate_layer_cb (CoglPipeline *pipeline,
if (!_cogl_texture_can_hardware_repeat (texture))
{
g_warning ("Disabling layer %d of the current source material, "
g_warning ("Disabling layer %d of the current source pipeline, "
"because texturing with the vertex buffer API is not "
"currently supported using sliced textures, or textures "
"with waste\n", layer_index);

View file

@ -365,7 +365,7 @@ cogl_context_has_winsys_feature (CoglContext *context,
* primitives you are 100% on your own since you stand a good chance of
* conflicting with Cogl internals. For example clutter-gst which currently
* uses direct GL calls to bind ARBfp programs will very likely break when Cogl
* starts to use ARBfb programs itself for the material API.
* starts to use ARBfb programs itself for the pipeline API.
*/
COGL_EXPORT void
cogl_context_flush (CoglContext *context);

View file

@ -794,7 +794,7 @@ cogl_framebuffer_draw_textured_rectangle (CoglFramebuffer *framebuffer,
*
* The first pair of coordinates are for the first layer (with the
* smallest layer index) and if you supply less texture coordinates
* than there are layers in the current source material then default
* than there are layers in the current source pipeline then default
* texture coordinates (0.0, 0.0, 1.0, 1.0) are generated.
*/
COGL_EXPORT void

View file

@ -618,7 +618,7 @@ _cogl_get_n_args_for_combine_func (CoglPipelineCombineFunc func);
*
* typedef struct {
* CoglPipeline *validated_source;
* } MyValidatedMaterialCache;
* } MyValidatedPipelineCache;
*
* static void
* destroy_cache_cb (CoglObject *object, void *user_data)
@ -629,7 +629,7 @@ _cogl_get_n_args_for_combine_func (CoglPipelineCombineFunc func);
* static void
* invalidate_cache_cb (CoglPipeline *destroyed, void *user_data)
* {
* MyValidatedMaterialCache *cache = user_data;
* MyValidatedPipelineCache *cache = user_data;
* g_object_unref (cache->validated_source);
* cache->validated_source = NULL;
* }
@ -638,12 +638,12 @@ _cogl_get_n_args_for_combine_func (CoglPipelineCombineFunc func);
* get_validated_pipeline (CoglPipeline *source)
* {
* _cogl_my_cache_key = g_quark_from_static_string ("my-cache-key");
* MyValidatedMaterialCache *cache =
* MyValidatedPipelineCache *cache =
* g_object_get_qdata (G_OBJECT (source),
* _cogl_my_cache_key);
* if (G_UNLIKELY (cache == NULL))
* {
* cache = g_new0 (MyValidatedMaterialCache, 1);
* cache = g_new0 (MyValidatedPipelineCache, 1);
*
* g_object_set_qdata_full (G_OBJECT (source),
* _cogl_my_cache_key,

View file

@ -96,4 +96,3 @@ _cogl_util_point_in_screen_poly (float point_x,
return c;
}

View file

@ -344,7 +344,7 @@ validate_tex_coords_cb (CoglPipeline *pipeline,
{
static gboolean warning_seen = FALSE;
if (!warning_seen)
g_warning ("Skipping layers 1..n of your material since "
g_warning ("Skipping layers 1..n of your pipeline since "
"the first layer doesn't support hardware "
"repeat (e.g. because of waste or use of "
"GL_TEXTURE_RECTANGLE_ARB) and you supplied "
@ -363,7 +363,7 @@ validate_tex_coords_cb (CoglPipeline *pipeline,
{
static gboolean warning_seen = FALSE;
if (!warning_seen)
g_warning ("Skipping layer %d of your material "
g_warning ("Skipping layer %d of your pipeline "
"since you have supplied texture coords "
"outside the range [0,1] but the texture "
"doesn't support hardware repeat (e.g. "

View file

@ -198,9 +198,9 @@ typedef enum
/* NB: The above definitions are taken from gl.h equivalents */
/* XXX: should this be CoglMaterialDepthTestFunction?
/* XXX: should this be CoglPipelineDepthTestFunction?
* It makes it very verbose but would be consistent with
* CoglMaterialWrapMode */
* CoglPipelineWrapMode */
/**
* CoglDepthTestFunction:

View file

@ -81,8 +81,8 @@ cogl_program_class_init (CoglProgramClass *class)
/* A CoglProgram is effectively just a list of shaders that will be
used together and a set of values for the custom uniforms. No
actual GL program is created - instead this is the responsibility
of the GLSL material backend. The uniform values are collected in
an array and then flushed whenever the material backend requests
of the GLSL pipeline backend. The uniform values are collected in
an array and then flushed whenever the pipeline backend requests
it. */
CoglProgram*

View file

@ -896,8 +896,8 @@ _cogl_pipeline_flush_gl_state (CoglContext *ctx,
COGL_STATIC_TIMER (pipeline_flush_timer,
"Mainloop", /* parent */
"Material Flush",
"The time spent flushing material state",
"Pipeline Flush",
"The time spent flushing pipeline state",
0 /* no application private data */);
COGL_TIMER_START (_cogl_uprof_context, pipeline_flush_timer);
@ -1123,7 +1123,7 @@ done:
}
/* Give the progend a chance to update any uniforms that might not
* depend on the material state. This is used on GLES2 to update the
* depend on the pipeline state. This is used on GLES2 to update the
* matrices */
if (progend->pre_paint)
progend->pre_paint (pipeline, framebuffer);

View file

@ -58,7 +58,7 @@ frame_cb (ClutterTimeline *timeline,
}
static void
material_rectangle_paint (ClutterActor *actor,
pipeline_rectangle_paint (ClutterActor *actor,
ClutterPaintContext *paint_context,
gpointer data)
{
@ -144,7 +144,7 @@ test_cogl_multitexture_main (int argc, char *argv[])
state->group = clutter_actor_new ();
clutter_actor_set_position (state->group, stage_w / 2, stage_h / 2);
g_signal_connect (state->group, "paint",
G_CALLBACK (material_rectangle_paint), state);
G_CALLBACK (pipeline_rectangle_paint), state);
files = g_new (gchar*, 4);
files[0] = g_build_filename (TESTS_DATADIR, "redhand_alpha.png", NULL);