cogl: Port Texture* away from CoglObject

- Make Texture a parent GObject class and move the vtable funcs as vfuncs
instead of an interface as we would like to have dispose free the TextureLoader.
- Make the various texture sub-types inherit from it.
- Make all the sub-types constructors return a CoglTexture instead of their respective
specific type. As most of the times, the used functions accept a CoglTexture,
like all the GTK widgets constructors returning GtkWidget.
- Fix up the basics of gi-docgen for all these types.
- Remove CoglPrimitiveTexture as it is useless: It is just a texture underhood.
- Remove CoglMetaTexture: for the exact same reason as above.
- Switch various memory management functions to use g_ variant instead of the cogl_ one

Note we would still want to get rid of the _cogl_texture_init which is something
for the next commit

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
This commit is contained in:
Bilal Elmoussaoui
2023-09-18 16:58:36 +02:00
committed by Marge Bot
parent 586c43d5a9
commit 863163cc6e
115 changed files with 2278 additions and 2449 deletions

View File

@ -613,7 +613,7 @@ meta_renderer_native_create_dma_buf_framebuffer (MetaRendererNative *renderer_n
uint64_t modifiers[1];
CoglPixelFormat cogl_format;
CoglEglImageFlags flags;
CoglTexture2D *cogl_tex;
CoglTexture *cogl_tex;
CoglOffscreen *cogl_fbo;
int ret;
@ -651,8 +651,8 @@ meta_renderer_native_create_dma_buf_framebuffer (MetaRendererNative *renderer_n
if (!cogl_tex)
return NULL;
cogl_fbo = cogl_offscreen_new_with_texture (COGL_TEXTURE (cogl_tex));
cogl_object_unref (cogl_tex);
cogl_fbo = cogl_offscreen_new_with_texture (cogl_tex);
g_object_unref (cogl_tex);
if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (cogl_fbo), error))
{
@ -1151,19 +1151,19 @@ meta_renderer_native_create_offscreen (MetaRendererNative *renderer,
GError **error)
{
CoglOffscreen *fb;
CoglTexture2D *tex;
CoglTexture *tex;
tex = cogl_texture_2d_new_with_size (context, view_width, view_height);
cogl_primitive_texture_set_auto_mipmap (COGL_PRIMITIVE_TEXTURE (tex), FALSE);
cogl_primitive_texture_set_auto_mipmap (tex, FALSE);
if (!cogl_texture_allocate (COGL_TEXTURE (tex), error))
if (!cogl_texture_allocate (tex, error))
{
cogl_object_unref (tex);
g_object_unref (tex);
return FALSE;
}
fb = cogl_offscreen_new_with_texture (COGL_TEXTURE (tex));
cogl_object_unref (tex);
fb = cogl_offscreen_new_with_texture (tex);
g_object_unref (tex);
if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (fb), error))
{
g_object_unref (fb);