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

@ -1632,7 +1632,7 @@ cogl_pipeline_add_fragment_hook (CoglPipeline *pipeline,
}
gboolean
_cogl_pipeline_has_vertex_snippets (CoglPipeline *pipeline)
_cogl_pipeline_has_non_layer_vertex_snippets (CoglPipeline *pipeline)
{
CoglPipeline *authority =
_cogl_pipeline_get_authority (pipeline,
@ -1641,6 +1641,22 @@ _cogl_pipeline_has_vertex_snippets (CoglPipeline *pipeline)
return !COGL_LIST_EMPTY (&authority->big_state->vertex_snippets);
}
gboolean
_cogl_pipeline_has_vertex_snippets (CoglPipeline *pipeline)
{
return _cogl_pipeline_has_non_layer_vertex_snippets (pipeline);
}
gboolean
_cogl_pipeline_has_non_layer_fragment_snippets (CoglPipeline *pipeline)
{
CoglPipeline *authority =
_cogl_pipeline_get_authority (pipeline,
COGL_PIPELINE_STATE_FRAGMENT_SNIPPETS);
return !COGL_LIST_EMPTY (&authority->big_state->fragment_snippets);
}
static gboolean
check_layer_has_fragment_snippet (CoglPipelineLayer *layer,
void *user_data)
@ -1662,12 +1678,9 @@ check_layer_has_fragment_snippet (CoglPipelineLayer *layer,
gboolean
_cogl_pipeline_has_fragment_snippets (CoglPipeline *pipeline)
{
CoglPipeline *authority =
_cogl_pipeline_get_authority (pipeline,
COGL_PIPELINE_STATE_FRAGMENT_SNIPPETS);
gboolean found_fragment_snippet = FALSE;
if (!COGL_LIST_EMPTY (&authority->big_state->fragment_snippets))
if (_cogl_pipeline_has_non_layer_fragment_snippets (pipeline))
return TRUE;
_cogl_pipeline_foreach_layer_internal (pipeline,