summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-27 18:27:53 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-27 18:28:52 +0100
commit53f086105975c1c2bd4c43a1b0613ebde3580e95 (patch)
tree087e065ac34e3f8e4b256a904064b571c374f30d
parentdd0866cdc878a0be438a117051ccc64f12f81970 (diff)
gl: Make _cairo_gl_shader_(init|compile) static
Only used within _cairo_gl_shaders.c, so remove the private symbol.
-rw-r--r--src/cairo-gl-private.h10
-rw-r--r--src/cairo-gl-shaders.c41
2 files changed, 25 insertions, 26 deletions
diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h
index dd4e1a46..960865c8 100644
--- a/src/cairo-gl-private.h
+++ b/src/cairo-gl-private.h
@@ -392,16 +392,6 @@ _cairo_gl_context_init_shaders (cairo_gl_context_t *ctx);
cairo_private void
_cairo_gl_context_fini_shaders (cairo_gl_context_t *ctx);
-cairo_private void
-_cairo_gl_shader_init (cairo_gl_shader_t *shader);
-
-cairo_private cairo_status_t
-_cairo_gl_shader_compile (cairo_gl_context_t *ctx,
- cairo_gl_shader_t *program,
- cairo_gl_var_type_t src,
- cairo_gl_var_type_t mask,
- const char *fragment_text);
-
cairo_private cairo_status_t
_cairo_gl_set_shader_by_type (cairo_gl_context_t *ctx,
cairo_gl_operand_type_t source,
diff --git a/src/cairo-gl-shaders.c b/src/cairo-gl-shaders.c
index c6ab07a6..fdd4b673 100644
--- a/src/cairo-gl-shaders.c
+++ b/src/cairo-gl-shaders.c
@@ -93,6 +93,13 @@ typedef struct cairo_gl_shader_impl {
(*use) (cairo_gl_shader_t *shader);
} shader_impl_t;
+static cairo_status_t
+_cairo_gl_shader_compile (cairo_gl_context_t *ctx,
+ cairo_gl_shader_t *shader,
+ cairo_gl_var_type_t src,
+ cairo_gl_var_type_t mask,
+ const char *fragment_text);
+
/* ARB_shader_objects / ARB_vertex_shader / ARB_fragment_shader extensions
API. */
static void
@@ -475,6 +482,13 @@ _cairo_gl_shader_cache_destroy (void *data)
free (entry);
}
+static void
+_cairo_gl_shader_init (cairo_gl_shader_t *shader)
+{
+ shader->fragment_shader = 0;
+ shader->program = 0;
+}
+
cairo_status_t
_cairo_gl_context_init_shaders (cairo_gl_context_t *ctx)
{
@@ -507,14 +521,16 @@ _cairo_gl_context_init_shaders (cairo_gl_context_t *ctx)
if (unlikely (status))
return status;
- _cairo_gl_shader_init (&ctx->fill_rectangles_shader);
- status = _cairo_gl_shader_compile (ctx,
- &ctx->fill_rectangles_shader,
- CAIRO_GL_VAR_NONE,
- CAIRO_GL_VAR_NONE,
- fill_fs_source);
- if (unlikely (status))
- return status;
+ if (ctx->shader_impl != NULL) {
+ _cairo_gl_shader_init (&ctx->fill_rectangles_shader);
+ status = _cairo_gl_shader_compile (ctx,
+ &ctx->fill_rectangles_shader,
+ CAIRO_GL_VAR_NONE,
+ CAIRO_GL_VAR_NONE,
+ fill_fs_source);
+ if (unlikely (status))
+ return status;
+ }
return CAIRO_STATUS_SUCCESS;
}
@@ -533,13 +549,6 @@ _cairo_gl_context_fini_shaders (cairo_gl_context_t *ctx)
}
void
-_cairo_gl_shader_init (cairo_gl_shader_t *shader)
-{
- shader->fragment_shader = 0;
- shader->program = 0;
-}
-
-void
_cairo_gl_shader_fini (cairo_gl_context_t *ctx,
cairo_gl_shader_t *shader)
{
@@ -809,7 +818,7 @@ cairo_gl_shader_get_fragment_source (GLuint tex_target,
return CAIRO_STATUS_SUCCESS;
}
-cairo_status_t
+static cairo_status_t
_cairo_gl_shader_compile (cairo_gl_context_t *ctx,
cairo_gl_shader_t *shader,
cairo_gl_var_type_t src,