mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
[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.
This commit is contained in:
parent
c52eda6715
commit
14cef57480
@ -1512,6 +1512,8 @@ cogl_set_source_texture (CoglHandle texture_handle)
|
|||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
CoglColor white;
|
CoglColor white;
|
||||||
|
|
||||||
|
g_return_if_fail (texture_handle != COGL_INVALID_HANDLE);
|
||||||
|
|
||||||
cogl_material_set_layer (ctx->default_material, 0, texture_handle);
|
cogl_material_set_layer (ctx->default_material, 0, texture_handle);
|
||||||
cogl_color_set_from_4ub (&white, 0xff, 0xff, 0xff, 0xff);
|
cogl_color_set_from_4ub (&white, 0xff, 0xff, 0xff, 0xff);
|
||||||
cogl_material_set_color (ctx->default_material, &white);
|
cogl_material_set_color (ctx->default_material, &white);
|
||||||
|
Loading…
Reference in New Issue
Block a user