cogl: Remove material_set_layer_filters

This function is deprecated and must be replaced to the alternative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
This commit is contained in:
Fernando Monteiro
2021-09-17 07:36:46 +01:00
committed by Marge Bot
parent 913458381f
commit 8285091585
7 changed files with 26 additions and 94 deletions

View File

@@ -127,14 +127,14 @@ on_paint (ClutterActor *actor,
/* We'll use nearest filtering mode on the textures, otherwise the
edge of the quad can pull in texels from the neighbouring
quarters of the texture due to imprecision */
cogl_material_set_layer_filters (material, 0,
COGL_MATERIAL_FILTER_NEAREST,
COGL_MATERIAL_FILTER_NEAREST);
cogl_pipeline_set_layer_filters (material, 0,
COGL_PIPELINE_FILTER_NEAREST,
COGL_PIPELINE_FILTER_NEAREST);
cogl_material_set_layer (material, 1, tex1);
cogl_material_set_layer_filters (material, 1,
COGL_MATERIAL_FILTER_NEAREST,
COGL_MATERIAL_FILTER_NEAREST);
cogl_pipeline_set_layer_filters (material, 1,
COGL_PIPELINE_FILTER_NEAREST,
COGL_PIPELINE_FILTER_NEAREST);
status = cogl_material_set_layer_combine (material, 1,
"RGBA = ADD (PREVIOUS, TEXTURE)",
&error);

View File

@@ -60,14 +60,14 @@ on_paint (ClutterActor *actor,
/* Render a 1x1 pixel quad without mipmaps */
cogl_set_source (material);
cogl_material_set_layer_filters (material, 0,
COGL_MATERIAL_FILTER_NEAREST,
COGL_MATERIAL_FILTER_NEAREST);
cogl_pipeline_set_layer_filters (material, 0,
COGL_PIPELINE_FILTER_NEAREST,
COGL_PIPELINE_FILTER_NEAREST);
cogl_rectangle (0, 0, 1, 1);
/* Then with mipmaps */
cogl_material_set_layer_filters (material, 0,
COGL_MATERIAL_FILTER_NEAREST_MIPMAP_NEAREST,
COGL_MATERIAL_FILTER_NEAREST);
cogl_pipeline_set_layer_filters (material, 0,
COGL_PIPELINE_FILTER_NEAREST_MIPMAP_NEAREST,
COGL_PIPELINE_FILTER_NEAREST);
cogl_rectangle (1, 0, 2, 1);
cogl_object_unref (material);

View File

@@ -152,14 +152,14 @@ on_after_paint (ClutterActor *actor,
{
const CoglMaterialFilter min_filter =
COGL_MATERIAL_FILTER_NEAREST_MIPMAP_NEAREST;
cogl_material_set_layer_filters (material, 0,
cogl_pipeline_set_layer_filters (material, 0,
min_filter,
COGL_MATERIAL_FILTER_NEAREST);
COGL_PIPELINE_FILTER_NEAREST);
}
else
cogl_material_set_layer_filters (material, 0,
COGL_MATERIAL_FILTER_NEAREST,
COGL_MATERIAL_FILTER_NEAREST);
cogl_pipeline_set_layer_filters (material, 0,
COGL_PIPELINE_FILTER_NEAREST,
COGL_PIPELINE_FILTER_NEAREST);
cogl_set_source (material);
cogl_rectangle (0, 0, PIXMAP_WIDTH, PIXMAP_HEIGHT);