mirror of
https://github.com/brl/mutter.git
synced 2025-04-14 06:09:39 +00:00
compositor/background: Avoid uninitialized variable warning
'code' may be used uninitialized in this function, so make sure to return early in this case.
This commit is contained in:
parent
7f6a77232f
commit
1dbefc4e36
@ -544,13 +544,8 @@ add_texture_lookup_shader (MetaBackground *self)
|
|||||||
{
|
{
|
||||||
MetaBackgroundPrivate *priv = self->priv;
|
MetaBackgroundPrivate *priv = self->priv;
|
||||||
CoglSnippet *snippet;
|
CoglSnippet *snippet;
|
||||||
const char *code;
|
const char *code = NULL;
|
||||||
|
|
||||||
ensure_pipeline (self);
|
|
||||||
|
|
||||||
snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_TEXTURE_LOOKUP,
|
|
||||||
TEXTURE_LOOKUP_SHADER_DECLARATIONS,
|
|
||||||
NULL);
|
|
||||||
if ((priv->effects & META_BACKGROUND_EFFECTS_BLUR) &&
|
if ((priv->effects & META_BACKGROUND_EFFECTS_BLUR) &&
|
||||||
(priv->effects & META_BACKGROUND_EFFECTS_DESATURATE))
|
(priv->effects & META_BACKGROUND_EFFECTS_DESATURATE))
|
||||||
code = BLUR_CODE "\n" DESATURATE_CODE;
|
code = BLUR_CODE "\n" DESATURATE_CODE;
|
||||||
@ -558,7 +553,14 @@ add_texture_lookup_shader (MetaBackground *self)
|
|||||||
code = BLUR_CODE;
|
code = BLUR_CODE;
|
||||||
else if (priv->effects & META_BACKGROUND_EFFECTS_DESATURATE)
|
else if (priv->effects & META_BACKGROUND_EFFECTS_DESATURATE)
|
||||||
code = DESATURATE_CODE;
|
code = DESATURATE_CODE;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
ensure_pipeline (self);
|
||||||
|
|
||||||
|
snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_TEXTURE_LOOKUP,
|
||||||
|
TEXTURE_LOOKUP_SHADER_DECLARATIONS,
|
||||||
|
NULL);
|
||||||
cogl_snippet_set_replace (snippet, code);
|
cogl_snippet_set_replace (snippet, code);
|
||||||
cogl_pipeline_add_layer_snippet (priv->pipeline, 0, snippet);
|
cogl_pipeline_add_layer_snippet (priv->pipeline, 0, snippet);
|
||||||
cogl_object_unref (snippet);
|
cogl_object_unref (snippet);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user