diff options
-rw-r--r-- | docs/reference/gdk/gdk4-sections.txt | 10 | ||||
-rw-r--r-- | gdk/gdkgltexture.c | 18 | ||||
-rw-r--r-- | gdk/gdkgltexture.h | 16 | ||||
-rw-r--r-- | gdk/gdkgltextureprivate.h | 4 | ||||
-rw-r--r-- | gdk/gdkmemorytexture.h | 14 | ||||
-rw-r--r-- | gdk/gdkmemorytextureprivate.h | 4 | ||||
-rw-r--r-- | gtk/gtkglarea.c | 2 |
7 files changed, 47 insertions, 21 deletions
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index 989c0feae1..c63a170560 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -751,6 +751,16 @@ gdk_texture_get_type GDK_TYPE_TEXTURE GDK_IS_TEXTURE GDK_TEXTURE +GdkGLTextureClass +gdk_gl_texture_get_type +GDK_TYPE_GL_TEXTURE +GDK_IS_GL_TEXTURE +GDK_GL_TEXTURE +GdkMemoryTextureClass +gdk_memory_texture_get_type +GDK_TYPE_MEMORY_TEXTURE +GDK_IS_MEMORY_TEXTURE +GDK_MEMORY_TEXTURE </SECTION> <SECTION> diff --git a/gdk/gdkgltexture.c b/gdk/gdkgltexture.c index 8f93dcb879..8d97c316a6 100644 --- a/gdk/gdkgltexture.c +++ b/gdk/gdkgltexture.c @@ -133,28 +133,26 @@ gdk_gl_texture_get_id (GdkGLTexture *self) /** * gdk_gl_texture_release: - * @texture: a #GdkTexture wrapping a GL texture + * @self: a #GdkTexture wrapping a GL texture * - * Releases the GL resources held by a #GdkTexture that - * was created with gdk_texture_new_for_gl(). + * Releases the GL resources held by a #GdkGLTexture that + * was created with gdk_gl_texture_new(). * * The texture contents are still available via the * gdk_texture_download() function, after this function * has been called. */ void -gdk_gl_texture_release (GdkTexture *texture) +gdk_gl_texture_release (GdkGLTexture *self) { - GdkGLTexture *self; GdkWindow *window; + GdkTexture *texture; cairo_t *cr; - g_return_if_fail (GDK_IS_GL_TEXTURE (texture)); - - self = GDK_GL_TEXTURE (texture); - + g_return_if_fail (GDK_IS_GL_TEXTURE (self)); g_return_if_fail (self->saved == NULL); + texture = GDK_TEXTURE (self); self->saved = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, texture->width, texture->height); @@ -178,7 +176,7 @@ gdk_gl_texture_release (GdkTexture *texture) } /** - * gdk_gl_texture_new: (constructor) + * gdk_gl_texture_new: * @context: a #GdkGLContext * @id: the ID of a texture that was created with @context * @width: the nominal width of the texture diff --git a/gdk/gdkgltexture.h b/gdk/gdkgltexture.h index e5d24bd605..82dae098e1 100644 --- a/gdk/gdkgltexture.h +++ b/gdk/gdkgltexture.h @@ -23,11 +23,23 @@ #error "Only <gdk/gdk.h> can be included directly." #endif -#include <gdk/gdktypes.h> #include <gdk/gdkglcontext.h> +#include <gdk/gdktexture.h> G_BEGIN_DECLS +#define GDK_TYPE_GL_TEXTURE (gdk_gl_texture_get_type ()) + +#define GDK_GL_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_GL_TEXTURE, GdkGLTexture)) +#define GDK_IS_GL_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_GL_TEXTURE)) + +typedef struct _GdkGLTexture GdkGLTexture; +typedef struct _GdkGLTextureClass GdkGLTextureClass; + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLTexture, g_object_unref) + +GDK_AVAILABLE_IN_ALL +GType gdk_gl_texture_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL GdkTexture * gdk_gl_texture_new (GdkGLContext *context, @@ -38,7 +50,7 @@ GdkTexture * gdk_gl_texture_new (GdkGLContext gpointer data); GDK_AVAILABLE_IN_ALL -void gdk_gl_texture_release (GdkTexture *texture); +void gdk_gl_texture_release (GdkGLTexture *texture); G_END_DECLS diff --git a/gdk/gdkgltextureprivate.h b/gdk/gdkgltextureprivate.h index 180a99d064..06035eea07 100644 --- a/gdk/gdkgltextureprivate.h +++ b/gdk/gdkgltextureprivate.h @@ -7,10 +7,6 @@ G_BEGIN_DECLS -#define GDK_TYPE_GL_TEXTURE (gdk_gl_texture_get_type ()) - -G_DECLARE_FINAL_TYPE (GdkGLTexture, gdk_gl_texture, GDK, GL_TEXTURE, GdkTexture) - GdkGLContext * gdk_gl_texture_get_context (GdkGLTexture *self); guint gdk_gl_texture_get_id (GdkGLTexture *self); diff --git a/gdk/gdkmemorytexture.h b/gdk/gdkmemorytexture.h index 31d30fbd7f..c02fc784d4 100644 --- a/gdk/gdkmemorytexture.h +++ b/gdk/gdkmemorytexture.h @@ -86,6 +86,20 @@ typedef enum { #error "Unknown byte order for GDK_MEMORY_DEFAULT" #endif +#define GDK_TYPE_MEMORY_TEXTURE (gdk_memory_texture_get_type ()) + +#define GDK_MEMORY_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_MEMORY_TEXTURE, GdkMemoryTexture)) +#define GDK_IS_MEMORY_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_MEMORY_TEXTURE)) + +typedef struct _GdkMemoryTexture GdkMemoryTexture; +typedef struct _GdkMemoryTextureClass GdkMemoryTextureClass; + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkMemoryTexture, g_object_unref) + + +GDK_AVAILABLE_IN_ALL +GType gdk_memory_texture_get_type (void) G_GNUC_CONST; + GDK_AVAILABLE_IN_ALL GdkTexture * gdk_memory_texture_new (int width, int height, diff --git a/gdk/gdkmemorytextureprivate.h b/gdk/gdkmemorytextureprivate.h index 9634b1ccf3..caa4b2014c 100644 --- a/gdk/gdkmemorytextureprivate.h +++ b/gdk/gdkmemorytextureprivate.h @@ -31,10 +31,6 @@ G_BEGIN_DECLS #define GDK_MEMORY_CAIRO_FORMAT_ARGB32 GDK_MEMORY_DEFAULT -#define GDK_TYPE_MEMORY_TEXTURE (gdk_memory_texture_get_type ()) - -G_DECLARE_FINAL_TYPE (GdkMemoryTexture, gdk_memory_texture, GDK, MEMORY_TEXTURE, GdkTexture) - GdkMemoryFormat gdk_memory_texture_get_format (GdkMemoryTexture *self); const guchar * gdk_memory_texture_get_data (GdkMemoryTexture *self); gsize gdk_memory_texture_get_stride (GdkMemoryTexture *self); diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c index e44c68ef66..85b3cb9906 100644 --- a/gtk/gtkglarea.c +++ b/gtk/gtkglarea.c @@ -386,7 +386,7 @@ delete_one_texture (gpointer data) Texture *texture = data; if (texture->holder) - gdk_gl_texture_release (texture->holder); + gdk_gl_texture_release (GDK_GL_TEXTURE (texture->holder)); if (texture->id != 0) { |