From 71b62e75d24eeee15c6522e6d67f6439fb1315c5 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 8 Jun 2009 12:18:34 +0100 Subject: [PATCH] [cogl] Don't allow calling cogl_set_source_texture with an INVALID_HANDLE Although the underlying materials should allow layers with INVALID_HANDLES it shouldn't be necissary to expose that via cogl_set_source_texture() and it's easier to resolve a warning/crash here than odd artefacts/crashes later in the pipeline. --- clutter/cogl/common/cogl-material.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clutter/cogl/common/cogl-material.c b/clutter/cogl/common/cogl-material.c index 7e3935bff..d39120be9 100644 --- a/clutter/cogl/common/cogl-material.c +++ b/clutter/cogl/common/cogl-material.c @@ -1512,6 +1512,8 @@ cogl_set_source_texture (CoglHandle texture_handle) _COGL_GET_CONTEXT (ctx, NO_RETVAL); CoglColor white; + g_return_if_fail (texture_handle != COGL_INVALID_HANDLE); + cogl_material_set_layer (ctx->default_material, 0, texture_handle); cogl_color_set_from_4ub (&white, 0xff, 0xff, 0xff, 0xff); cogl_material_set_color (ctx->default_material, &white);