cogl: Rename Shader/Program constructors

Otherwise they end up as global functions instead of constructors
of their corresponding types. Helps with better docs

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
This commit is contained in:
Bilal Elmoussaoui
2024-07-28 14:49:13 +02:00
committed by Marge Bot
parent 716f23c7c1
commit b07c772fc8
8 changed files with 24 additions and 25 deletions

View File

@ -204,10 +204,10 @@ set_shader_num (int new_no)
shader_pipeline = cogl_pipeline_new (ctx);
shader = cogl_create_shader (COGL_SHADER_TYPE_FRAGMENT);
shader = cogl_shader_new (COGL_SHADER_TYPE_FRAGMENT);
cogl_shader_source (shader, shaders[new_no].source);
program = cogl_create_program ();
program = cogl_program_new ();
cogl_program_attach_shader (program, shader);
g_object_unref (shader);
cogl_program_link (program);
@ -358,4 +358,3 @@ test_cogl_shader_glsl_main (int argc, char *argv[])
return EXIT_SUCCESS;
}

View File

@ -58,7 +58,7 @@ paint (TestState *state)
/* Set up a dummy vertex shader that does nothing but the usual
fixed function transform */
shader = cogl_create_shader (COGL_SHADER_TYPE_VERTEX);
shader = cogl_shader_new (COGL_SHADER_TYPE_VERTEX);
cogl_shader_source (shader,
"void\n"
"main ()\n"
@ -70,7 +70,7 @@ paint (TestState *state)
" cogl_tex_coord_out[0] = cogl_tex_coord_in;\n"
"}\n");
program = cogl_create_program ();
program = cogl_program_new ();
cogl_program_attach_shader (program, shader);
cogl_program_link (program);

View File

@ -94,10 +94,10 @@ create_pipeline_for_shader (TestState *state, const char *shader_source)
pipeline = cogl_pipeline_new (test_ctx);
shader = cogl_create_shader (COGL_SHADER_TYPE_FRAGMENT);
shader = cogl_shader_new (COGL_SHADER_TYPE_FRAGMENT);
cogl_shader_source (shader, shader_source);
program = cogl_create_program ();
program = cogl_program_new ();
cogl_program_attach_shader (program, shader);
cogl_pipeline_set_user_program (pipeline, program);