diff options
author | Neil Roberts <neil@linux.intel.com> | 2011-11-25 17:59:52 +0000 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2011-12-06 19:02:06 +0000 |
commit | 5be5a033431597efc1f3b368a51a59e5b84e66ec (patch) | |
tree | 0fa32d688121a8aa97ff6c9eb718ffed1ef03716 /cogl/cogl-pipeline-layer.c | |
parent | df0f9a862ff338463e2a677337fa466e6cb7b5c5 (diff) | |
download | cogl-5be5a033431597efc1f3b368a51a59e5b84e66ec.tar.gz |
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>
Diffstat (limited to 'cogl/cogl-pipeline-layer.c')
-rw-r--r-- | cogl/cogl-pipeline-layer.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cogl/cogl-pipeline-layer.c b/cogl/cogl-pipeline-layer.c index 86e07508..76d17e74 100644 --- a/cogl/cogl-pipeline-layer.c +++ b/cogl/cogl-pipeline-layer.c @@ -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; } |