diff options
author | Robert Bragg <robert.bragg@intel.com> | 2014-03-17 14:07:48 +0000 |
---|---|---|
committer | Robert Bragg <robert.bragg@intel.com> | 2014-03-24 19:37:22 +0000 |
commit | 6e69b69180addd60e963e684314f5dc122c442e3 (patch) | |
tree | 4a2cb7bead10c353ff14f1c7cd7caca154a4bf47 /cogl/cogl-blend-string.c | |
parent | 4c4d90fb09316201fb5c7af6c3416a51ae0c972b (diff) | |
download | cogl-6e69b69180addd60e963e684314f5dc122c442e3.tar.gz |
blend-string: Avoid using _COGL_GET_CONTEXT
Although this just moves the _GET_CONTEXT() into the cogl-pipeline code,
it means we have one less component in cogl depending on a global
context. CoglPipeline is one of the only remaining components that
heavily depends on a global context and will probably be the last
component we tackle.
Diffstat (limited to 'cogl/cogl-blend-string.c')
-rw-r--r-- | cogl/cogl-blend-string.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/cogl/cogl-blend-string.c b/cogl/cogl-blend-string.c index 9fe3ed17..884ab77d 100644 --- a/cogl/cogl-blend-string.c +++ b/cogl/cogl-blend-string.c @@ -212,7 +212,8 @@ error: } static CoglBool -validate_blend_statements (CoglBlendStringStatement *statements, +validate_blend_statements (CoglContext *ctx, + CoglBlendStringStatement *statements, int n_statements, CoglError **error) { @@ -220,8 +221,6 @@ validate_blend_statements (CoglBlendStringStatement *statements, const char *error_string; CoglBlendStringError detail = COGL_BLEND_STRING_ERROR_INVALID_ERROR; - _COGL_GET_CONTEXT (ctx, 0); - if (n_statements == 2 && !ctx->glBlendEquationSeparate && statements[0].function->type != statements[1].function->type) @@ -276,7 +275,8 @@ error: } static CoglBool -validate_statements_for_context (CoglBlendStringStatement *statements, +validate_statements_for_context (CoglContext *ctx, + CoglBlendStringStatement *statements, int n_statements, CoglBlendStringContext context, CoglError **error) @@ -300,7 +300,7 @@ validate_statements_for_context (CoglBlendStringStatement *statements, } if (context == COGL_BLEND_STRING_CONTEXT_BLENDING) - return validate_blend_statements (statements, n_statements, error); + return validate_blend_statements (ctx, statements, n_statements, error); else return validate_tex_combine_statements (statements, n_statements, error); @@ -753,7 +753,8 @@ error: } int -_cogl_blend_string_compile (const char *string, +_cogl_blend_string_compile (CoglContext *ctx, + const char *string, CoglBlendStringContext context, CoglBlendStringStatement *statements, CoglError **error) @@ -905,7 +906,8 @@ finished: print_statement (1, &statements[1]); } - if (!validate_statements_for_context (statements, + if (!validate_statements_for_context (ctx, + statements, current_statement, context, error)) @@ -1003,7 +1005,8 @@ UNIT_TEST (blend_string_parsing, for (i = 0; tests[i].string; i++) { CoglBlendStringStatement statements[2]; - _cogl_blend_string_compile (tests[i].string, + _cogl_blend_string_compile (test_ctx, + tests[i].string, tests[i].context, statements, &error); |