mirror of
https://github.com/brl/mutter.git
synced 2024-11-30 03:50:47 -05:00
[cogl] handle_automatic_blend_enable(): consider layers with invalid textures
A layer object may be instantiated when setting a combine mode, but before a texture is associated. (e.g. this is done by the pango renderer) if this is the case we shouldn't call cogl_texture_get_format() with an invalid cogl handle. This patch skips over layers without a texture handle when determining if any textures have an alpha channel.
This commit is contained in:
parent
8a1b4f8326
commit
04ebd6be44
@ -100,6 +100,12 @@ handle_automatic_blend_enable (CoglMaterial *material)
|
|||||||
for (tmp = material->layers; tmp != NULL; tmp = tmp->next)
|
for (tmp = material->layers; tmp != NULL; tmp = tmp->next)
|
||||||
{
|
{
|
||||||
CoglMaterialLayer *layer = tmp->data;
|
CoglMaterialLayer *layer = tmp->data;
|
||||||
|
|
||||||
|
/* NB: A layer may have a combine mode set on it but not yet have an
|
||||||
|
* associated texture. */
|
||||||
|
if (!layer->texture)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (cogl_texture_get_format (layer->texture) & COGL_A_BIT)
|
if (cogl_texture_get_format (layer->texture) & COGL_A_BIT)
|
||||||
material->flags |= COGL_MATERIAL_FLAG_ENABLE_BLEND;
|
material->flags |= COGL_MATERIAL_FLAG_ENABLE_BLEND;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user