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:

committed by
Marge Bot

parent
586c43d5a9
commit
863163cc6e
@ -96,7 +96,7 @@ meta_cursor_sprite_clear_texture (MetaCursorSprite *sprite)
|
||||
MetaCursorSpritePrivate *priv =
|
||||
meta_cursor_sprite_get_instance_private (sprite);
|
||||
|
||||
g_clear_pointer (&priv->texture, cogl_object_unref);
|
||||
g_clear_object (&priv->texture);
|
||||
meta_cursor_sprite_invalidate (sprite);
|
||||
}
|
||||
|
||||
@ -109,9 +109,9 @@ meta_cursor_sprite_set_texture (MetaCursorSprite *sprite,
|
||||
MetaCursorSpritePrivate *priv =
|
||||
meta_cursor_sprite_get_instance_private (sprite);
|
||||
|
||||
g_clear_pointer (&priv->texture, cogl_object_unref);
|
||||
g_clear_object (&priv->texture);
|
||||
if (texture)
|
||||
priv->texture = cogl_object_ref (texture);
|
||||
priv->texture = g_object_ref (COGL_TEXTURE_2D (texture));
|
||||
priv->hot_x = hot_x;
|
||||
priv->hot_y = hot_y;
|
||||
|
||||
@ -264,7 +264,7 @@ meta_cursor_sprite_constructed (GObject *object)
|
||||
|
||||
meta_cursor_tracker_register_cursor_sprite (priv->cursor_tracker, sprite);
|
||||
|
||||
g_clear_pointer (&priv->texture, cogl_object_unref);
|
||||
g_clear_object (&priv->texture);
|
||||
|
||||
G_OBJECT_CLASS (meta_cursor_sprite_parent_class)->constructed (object);
|
||||
}
|
||||
@ -276,7 +276,7 @@ meta_cursor_sprite_finalize (GObject *object)
|
||||
MetaCursorSpritePrivate *priv =
|
||||
meta_cursor_sprite_get_instance_private (sprite);
|
||||
|
||||
g_clear_pointer (&priv->texture, cogl_object_unref);
|
||||
g_clear_object (&priv->texture);
|
||||
|
||||
meta_cursor_tracker_unregister_cursor_sprite (priv->cursor_tracker, sprite);
|
||||
g_clear_object (&priv->cursor_tracker);
|
||||
|
Reference in New Issue
Block a user