diff --git a/common/cogl-material.c b/common/cogl-material.c index 49688d4f4..86189b93a 100644 --- a/common/cogl-material.c +++ b/common/cogl-material.c @@ -1914,9 +1914,10 @@ cogl_set_source (CoglHandle material_handle) void cogl_set_source_texture (CoglHandle texture_handle) { - _COGL_GET_CONTEXT (ctx, NO_RETVAL); CoglColor white; + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + g_return_if_fail (texture_handle != COGL_INVALID_HANDLE); cogl_material_set_layer (ctx->default_material, 0, texture_handle); diff --git a/common/cogl-matrix.c b/common/cogl-matrix.c index d4cacaedd..1de2a6146 100644 --- a/common/cogl-matrix.c +++ b/common/cogl-matrix.c @@ -88,9 +88,11 @@ cogl_matrix_rotate (CoglMatrix *matrix, { CoglMatrix rotation; CoglMatrix result; + float c, s; + angle *= G_PI / 180.0f; - float c = cosf (angle); - float s = sinf (angle); + c = cosf (angle); + s = sinf (angle); rotation.xx = x * x * (1.0f - c) + c; rotation.yx = y * x * (1.0f - c) + z * s;