static void _cogl_texture_pixmap_x11_free (CoglTexturePixmapX11 *tex_pixmap) { _COGL_GET_CONTEXT (ctxt, NO_RETVAL); set_damage_object_internal (ctxt, tex_pixmap, 0, 0); if (tex_pixmap->image) XDestroyImage (tex_pixmap->image); if (tex_pixmap->shm_info.shmid != -1) { XShmDetach (cogl_xlib_get_display (), &tex_pixmap->shm_info); shmdt (tex_pixmap->shm_info.shmaddr); shmctl (tex_pixmap->shm_info.shmid, IPC_RMID, 0); } if (tex_pixmap->tex) cogl_handle_unref (tex_pixmap->tex); if (tex_pixmap->winsys) { const CoglWinsysVtable *winsys = _cogl_texture_pixmap_x11_get_winsys (tex_pixmap); winsys->texture_pixmap_x11_free (tex_pixmap); } /* Chain up */ _cogl_texture_free (COGL_TEXTURE (tex_pixmap)); }
static void _cogl_texture_pixmap_x11_free (CoglTexturePixmapX11 *tex_pixmap) { set_damage_object_internal (tex_pixmap, 0, 0); if (tex_pixmap->image) XDestroyImage (tex_pixmap->image); if (tex_pixmap->shm_info.shmid != -1) { XShmDetach (_cogl_xlib_get_display (), &tex_pixmap->shm_info); shmdt (tex_pixmap->shm_info.shmaddr); shmctl (tex_pixmap->shm_info.shmid, IPC_RMID, 0); } if (tex_pixmap->tex) cogl_handle_unref (tex_pixmap->tex); #ifdef COGL_HAS_GLX_SUPPORT _cogl_texture_pixmap_x11_free_glx_pixmap (tex_pixmap); if (tex_pixmap->glx_tex) cogl_handle_unref (tex_pixmap->glx_tex); #endif /* Chain up */ _cogl_texture_free (COGL_TEXTURE (tex_pixmap)); }
static void _cogl_texture_3d_free (CoglTexture3D *tex_3d) { if (tex_3d->gl_texture) _cogl_delete_gl_texture (tex_3d->gl_texture); /* Chain up */ _cogl_texture_free (COGL_TEXTURE (tex_3d)); }
static void _cogl_sub_texture_free (CoglSubTexture *sub_tex) { cogl_object_unref (sub_tex->next_texture); cogl_object_unref (sub_tex->full_texture); /* Chain up */ _cogl_texture_free (COGL_TEXTURE (sub_tex)); }
static void _cogl_texture_rectangle_free (CoglTextureRectangle *tex_rect) { if (!tex_rect->is_foreign && tex_rect->gl_texture) _cogl_delete_gl_texture (tex_rect->gl_texture); /* Chain up */ _cogl_texture_free (COGL_TEXTURE (tex_rect)); }
static void _cogl_texture_pixmap_x11_free (CoglTexturePixmapX11 *tex_pixmap) { Display *display; _COGL_GET_CONTEXT (ctxt, NO_RETVAL); if (tex_pixmap->stereo_mode == COGL_TEXTURE_PIXMAP_RIGHT) { cogl_object_unref (tex_pixmap->left); /* Chain up */ _cogl_texture_free (COGL_TEXTURE (tex_pixmap)); return; } display = cogl_xlib_renderer_get_display (ctxt->display->renderer); set_damage_object_internal (ctxt, tex_pixmap, 0, 0); if (tex_pixmap->image) XDestroyImage (tex_pixmap->image); if (tex_pixmap->shm_info.shmid != -1) { XShmDetach (display, &tex_pixmap->shm_info); shmdt (tex_pixmap->shm_info.shmaddr); shmctl (tex_pixmap->shm_info.shmid, IPC_RMID, 0); } if (tex_pixmap->tex) cogl_object_unref (tex_pixmap->tex); if (tex_pixmap->winsys) { const CoglWinsysVtable *winsys = _cogl_texture_pixmap_x11_get_winsys (tex_pixmap); winsys->texture_pixmap_x11_free (tex_pixmap); } /* Chain up */ _cogl_texture_free (COGL_TEXTURE (tex_pixmap)); }
static void _cogl_texture_2d_free (CoglTexture2D *tex_2d) { CoglContext *ctx = COGL_TEXTURE (tex_2d)->context; ctx->driver_vtable->texture_2d_free (tex_2d); /* Chain up */ _cogl_texture_free (COGL_TEXTURE (tex_2d)); }