cogl-primitives: Don't warn if using sliced textures without multi-tex

cogl_rectangle has some validation code to check whether the first
layer has a sliced texture. If so it will abandon the rest of the
layers and print a warning. However it was even doing this pruning and
displaying the warning if there is only one layer. This patch just
makes it check whether the pipeline actually has more than one layer
before pruning or displaying the warning but it will still fallback to
the multiple quads path.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
Neil Roberts 2011-09-19 15:22:04 +01:00 committed by Robert Bragg
parent dbff3a357e
commit 1984fea4b1

View File

@ -635,13 +635,14 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
if (cogl_texture_is_sliced (texture))
{
if (state->i == 0)
{
if (cogl_pipeline_get_n_layers (pipeline) > 1)
{
static gboolean warning_seen = FALSE;
if (!state->override_source)
state->override_source = cogl_pipeline_copy (pipeline);
_cogl_pipeline_prune_to_n_layers (state->override_source, 1);
state->all_use_sliced_quad_fallback = TRUE;
if (!warning_seen)
g_warning ("Skipping layers 1..n of your pipeline since "
@ -650,6 +651,9 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
"textures but assume layer 0 is the most "
"important to keep");
warning_seen = TRUE;
}
state->all_use_sliced_quad_fallback = TRUE;
return FALSE;
}