forked from AuroraMiddleware/gtk
Merge branch 'small-gltexture-cleanup' into 'main'
gltexture: Small refactoring See merge request GNOME/gtk!5464
This commit is contained in:
commit
e6998dffe8
@ -53,10 +53,8 @@ struct _GdkGLTextureClass {
|
|||||||
G_DEFINE_TYPE (GdkGLTexture, gdk_gl_texture, GDK_TYPE_TEXTURE)
|
G_DEFINE_TYPE (GdkGLTexture, gdk_gl_texture, GDK_TYPE_TEXTURE)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_gl_texture_dispose (GObject *object)
|
drop_gl_resources (GdkGLTexture *self)
|
||||||
{
|
{
|
||||||
GdkGLTexture *self = GDK_GL_TEXTURE (object);
|
|
||||||
|
|
||||||
if (self->destroy)
|
if (self->destroy)
|
||||||
{
|
{
|
||||||
self->destroy (self->data);
|
self->destroy (self->data);
|
||||||
@ -66,6 +64,14 @@ gdk_gl_texture_dispose (GObject *object)
|
|||||||
|
|
||||||
g_clear_object (&self->context);
|
g_clear_object (&self->context);
|
||||||
self->id = 0;
|
self->id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gdk_gl_texture_dispose (GObject *object)
|
||||||
|
{
|
||||||
|
GdkGLTexture *self = GDK_GL_TEXTURE (object);
|
||||||
|
|
||||||
|
drop_gl_resources (self);
|
||||||
|
|
||||||
g_clear_object (&self->saved);
|
g_clear_object (&self->saved);
|
||||||
|
|
||||||
@ -301,15 +307,7 @@ gdk_gl_texture_release (GdkGLTexture *self)
|
|||||||
self->saved = GDK_TEXTURE (gdk_memory_texture_from_texture (texture,
|
self->saved = GDK_TEXTURE (gdk_memory_texture_from_texture (texture,
|
||||||
gdk_texture_get_format (texture)));
|
gdk_texture_get_format (texture)));
|
||||||
|
|
||||||
if (self->destroy)
|
drop_gl_resources (self);
|
||||||
{
|
|
||||||
self->destroy (self->data);
|
|
||||||
self->destroy = NULL;
|
|
||||||
self->data = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_clear_object (&self->context);
|
|
||||||
self->id = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user