summaryrefslogtreecommitdiff
path: root/gdk/gdkgltexture.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-03-18 05:14:52 +0100
committerBenjamin Otte <otte@redhat.com>2018-03-18 05:57:07 +0100
commit82a99a3643f49632e9c633c294ab47044daab3c5 (patch)
tree78b92f398ac18ccfa37062d4de0b9ba05cdd1cbd /gdk/gdkgltexture.c
parentd54ca3c74f360c36810ec21ecac5d7f5065bba9f (diff)
downloadgtk+-82a99a3643f49632e9c633c294ab47044daab3c5.tar.gz
texture: Expose subclasses as subclasses
This is necessary so that bidnings work properly and don't make gdk_gl_texture_release() a function on GdkTexture. It also allows code to identify what type of texture they are dealing with. Finally, we can now decide to add getters later without screwing anything up, if we want to allow people to access GL textures directly.
Diffstat (limited to 'gdk/gdkgltexture.c')
-rw-r--r--gdk/gdkgltexture.c18
1 files changed, 8 insertions, 10 deletions
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