pipeline: Assume blend enabled when there are snippets

Whenever snippets are enabled we can't determine whether the final
color will be fully opaque so we just have to assume blending should
be enabled.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
Neil Roberts
2011-11-25 17:59:52 +00:00
committed by Robert Bragg
parent df0f9a862f
commit 5be5a03343
4 changed files with 43 additions and 5 deletions

View File

@ -78,6 +78,7 @@ _cogl_pipeline_layer_has_alpha (CoglPipelineLayer *layer)
COGL_PIPELINE_LAYER_STATE_COMBINE);
CoglPipelineLayerBigState *big_state = combine_authority->big_state;
CoglPipelineLayer *tex_authority;
CoglPipelineLayer *snippets_authority;
/* has_alpha maintains the alpha status for the GL_PREVIOUS layer */
@ -112,6 +113,12 @@ _cogl_pipeline_layer_has_alpha (CoglPipelineLayer *layer)
return TRUE;
}
/* All bets are off if the layer contains any snippets */
snippets_authority = _cogl_pipeline_layer_get_authority
(layer, COGL_PIPELINE_LAYER_STATE_FRAGMENT_SNIPPETS);
if (!COGL_LIST_EMPTY (&snippets_authority->big_state->fragment_snippets))
return TRUE;
return FALSE;
}