static void
NEGFiniScreen (CompPlugin *p,
	       CompScreen *s)
{
    NEG_SCREEN (s);

    freeWindowPrivateIndex (s, ns->windowPrivateIndex);

    UNWRAP (ns, s, drawWindowTexture);

    if (ns->negFunction)
	destroyFragmentFunction (s, ns->negFunction);
    if (ns->negAlphaFunction)
	destroyFragmentFunction (s, ns->negAlphaFunction);

    free (ns);
}
Example #2
0
static void
waterFiniScreen (CompPlugin *p,
		 CompScreen *s)
{
    WaterFunction *function, *next;
    int		  i;

    WATER_SCREEN (s);

    if (ws->rainHandle)
	compRemoveTimeout (ws->rainHandle);

    if (ws->wiperHandle)
	compRemoveTimeout (ws->wiperHandle);

    if (ws->fbo)
	(*s->deleteFramebuffers) (1, &ws->fbo);

    for (i = 0; i < TEXTURE_NUM; i++)
    {
	if (ws->texture[i])
	    glDeleteTextures (1, &ws->texture[i]);
    }

    if (ws->program)
	(*s->deletePrograms) (1, &ws->program);

    if (ws->data)
	free (ws->data);

    function = ws->bumpMapFunctions;
    while (function)
    {
	destroyFragmentFunction (s, function->handle);

	next = function->next;
	free (function);
	function = next;
    }

    UNWRAP (ws, s, preparePaintScreen);
    UNWRAP (ws, s, donePaintScreen);
    UNWRAP (ws, s, drawWindowTexture);

    free (ws);
}
Example #3
0
File: video.c Project: zmike/compiz
static void
videoDestroyFragmentFunctions(CompScreen *s,
                              VideoFunction **videoFunctions)
{
   VideoFunction *function, *next;

   function = *videoFunctions;
   while (function)
     {
        destroyFragmentFunction(s, function->handle);

        next = function->next;
        free(function);
        function = next;
     }

   *videoFunctions = NULL;
}
/*
 * Free filters resources if any
 */
static void
unloadFilters (CompScreen *s)
{
    int i;

    FILTER_SCREEN (s);

    if (cfs->filtersFunctions)
    {
	/* Destroy loaded filters one by one */
	for (i = 0; i < cfs->filtersCount; i++)
	{
	    if (cfs->filtersFunctions[i])
		destroyFragmentFunction (s, cfs->filtersFunctions[i]);
	}
	free (cfs->filtersFunctions);
	cfs->filtersFunctions = NULL;
	cfs->filtersCount = 0;
	/* Reset current filter */
	cfs->currentFilter = 0;
    }
}