[PATCH v4 06/10] gles2-renderer: Renaming some functions.

John Kåre Alsaker john.kare.alsaker at gmail.com
Mon Oct 29 14:17:14 PDT 2012


---
 src/gles2-renderer.c | 37 ++++++++++++++++++-------------------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/src/gles2-renderer.c b/src/gles2-renderer.c
index 0a05899..fc9e06e 100644
--- a/src/gles2-renderer.c
+++ b/src/gles2-renderer.c
@@ -640,7 +640,7 @@ use_output(struct weston_output *output)
 }
 
 static void
-weston_compositor_use_shader(struct weston_compositor *compositor,
+use_shader(struct weston_compositor *compositor,
 			     struct weston_shader *shader)
 {
 	if (compositor->current_shader == shader)
@@ -651,7 +651,7 @@ weston_compositor_use_shader(struct weston_compositor *compositor,
 }
 
 static void
-weston_shader_uniforms(struct weston_shader *shader,
+shader_uniforms(struct weston_shader *shader,
 		       struct weston_surface *surface,
 		       struct weston_output *output)
 {
@@ -694,12 +694,12 @@ draw_surface(struct weston_surface *es, struct weston_output *output,
 	glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
 
 	if (ec->fan_debug) {
-		weston_compositor_use_shader(ec, &ec->solid_shader);
-		weston_shader_uniforms(&ec->solid_shader, es, output);
+		use_shader(ec, &ec->solid_shader);
+		shader_uniforms(&ec->solid_shader, es, output);
 	}
 
-	weston_compositor_use_shader(ec, es->shader);
-	weston_shader_uniforms(es->shader, es, output);
+	use_shader(ec, es->shader);
+	shader_uniforms(es->shader, es, output);
 
 	if (es->transform.enabled || output->zoom.active)
 		filter = GL_LINEAR;
@@ -725,8 +725,8 @@ draw_surface(struct weston_surface *es, struct weston_output *output,
 			 * that forces texture alpha = 1.0.
 			 * Xwayland surfaces need this.
 			 */
-			weston_compositor_use_shader(ec, &ec->texture_shader_rgbx);
-			weston_shader_uniforms(&ec->texture_shader_rgbx, es, output);
+			use_shader(ec, &ec->texture_shader_rgbx);
+			shader_uniforms(&ec->texture_shader_rgbx, es, output);
 		}
 
 		if (es->alpha < 1.0)
@@ -738,7 +738,7 @@ draw_surface(struct weston_surface *es, struct weston_output *output,
 	}
 
 	if (pixman_region32_not_empty(&surface_blend)) {
-		weston_compositor_use_shader(ec, es->shader);
+		use_shader(ec, es->shader);
 		glEnable(GL_BLEND);
 		repaint_region(es, &repaint, &surface_blend);
 	}
@@ -847,8 +847,7 @@ draw_border(struct weston_output *output)
 	int n;
 
 	glDisable(GL_BLEND);
-	glUseProgram(shader->program);
-	ec->current_shader = shader;
+	use_shader(ec, shader);
 
 	glUniformMatrix4fv(shader->proj_uniform,
 			   1, GL_FALSE, output->matrix.d);
@@ -1283,7 +1282,7 @@ compile_shader(GLenum type, const char *source)
 }
 
 static int
-weston_shader_init(struct weston_shader *shader,
+shader_init(struct weston_shader *shader,
 		   const char *vertex_source, const char *fragment_source)
 {
 	char msg[512];
@@ -1665,26 +1664,26 @@ gles2_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
 
 	glActiveTexture(GL_TEXTURE0);
 
-	if (weston_shader_init(&ec->texture_shader_rgba,
+	if (shader_init(&ec->texture_shader_rgba,
 			     vertex_shader, texture_fragment_shader_rgba) < 0)
 		return -1;
-	if (weston_shader_init(&ec->texture_shader_rgbx,
+	if (shader_init(&ec->texture_shader_rgbx,
 			     vertex_shader, texture_fragment_shader_rgbx) < 0)
 		return -1;
 	if (has_egl_image_external &&
-			weston_shader_init(&ec->texture_shader_egl_external,
+			shader_init(&ec->texture_shader_egl_external,
 				vertex_shader, texture_fragment_shader_egl_external) < 0)
 		return -1;
-	if (weston_shader_init(&ec->texture_shader_y_uv,
+	if (shader_init(&ec->texture_shader_y_uv,
 			       vertex_shader, texture_fragment_shader_y_uv) < 0)
 		return -1;
-	if (weston_shader_init(&ec->texture_shader_y_u_v,
+	if (shader_init(&ec->texture_shader_y_u_v,
 			       vertex_shader, texture_fragment_shader_y_u_v) < 0)
 		return -1;
-	if (weston_shader_init(&ec->texture_shader_y_xuxv,
+	if (shader_init(&ec->texture_shader_y_xuxv,
 			       vertex_shader, texture_fragment_shader_y_xuxv) < 0)
 		return -1;
-	if (weston_shader_init(&ec->solid_shader,
+	if (shader_init(&ec->solid_shader,
 			     vertex_shader, solid_fragment_shader) < 0)
 		return -1;
 
-- 
1.7.12.4



More information about the wayland-devel mailing list