From cd71b91440f53618e5ad2db7618a0c36466ac4ea Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 6 Jan 2009 16:09:55 +0000 Subject: [PATCH] [cogl-material] Make the user_tex_coords parameter of _rectangle const The array is only used for input so it should be const. --- cogl-texture.h | 12 ++++++------ gl/cogl-texture.c | 14 +++++++------- gles/cogl-texture.c | 12 ++++++------ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cogl-texture.h b/cogl-texture.h index 331407618..2780b5db2 100644 --- a/cogl-texture.h +++ b/cogl-texture.h @@ -409,12 +409,12 @@ void cogl_texture_polygon (CoglHandle handle, * layers in the current source material then default texture coordinates * [0.0, 0.0, 1.0, 1.0] are generated. */ -void cogl_material_rectangle (CoglFixed x1, - CoglFixed y1, - CoglFixed x2, - CoglFixed y2, - gint tex_coords_len, - CoglFixed *tex_coords); +void cogl_material_rectangle (CoglFixed x1, + CoglFixed y1, + CoglFixed x2, + CoglFixed y2, + gint tex_coords_len, + const CoglFixed *tex_coords); G_END_DECLS diff --git a/gl/cogl-texture.c b/gl/cogl-texture.c index 357fc2885..f80a54e52 100644 --- a/gl/cogl-texture.c +++ b/gl/cogl-texture.c @@ -2407,12 +2407,12 @@ cogl_texture_polygon (CoglHandle handle, } void -cogl_material_rectangle (CoglFixed x1, - CoglFixed y1, - CoglFixed x2, - CoglFixed y2, - gint user_tex_coords_len, - CoglFixed *user_tex_coords) +cogl_material_rectangle (CoglFixed x1, + CoglFixed y1, + CoglFixed x2, + CoglFixed y2, + gint user_tex_coords_len, + const CoglFixed *user_tex_coords) { CoglHandle material; const GList *layers; @@ -2487,7 +2487,7 @@ cogl_material_rectangle (CoglFixed x1, { CoglHandle layer = valid_layers[i]; CoglHandle texture = cogl_material_layer_get_texture (layer); - CoglFixed *in_tex_coords; + const CoglFixed *in_tex_coords; GLfloat *out_tex_coords = &tex_coords_buff[i * 8]; GLuint gl_tex_handle; diff --git a/gles/cogl-texture.c b/gles/cogl-texture.c index a745e3b31..1fbd6c9fb 100644 --- a/gles/cogl-texture.c +++ b/gles/cogl-texture.c @@ -2498,11 +2498,11 @@ cogl_texture_polygon (CoglHandle handle, } void -cogl_material_rectangle (CoglFixed x1, - CoglFixed y1, - CoglFixed x2, - CoglFixed y2, - CoglFixed *user_tex_coords) +cogl_material_rectangle (CoglFixed x1, + CoglFixed y1, + CoglFixed x2, + CoglFixed y2, + const CoglFixed *user_tex_coords) { CoglHandle material; const GList *layers; @@ -2568,7 +2568,7 @@ cogl_material_rectangle (CoglFixed x1, CoglHandle layer = valid_layers[i]; CoglHandle texture_handle = cogl_material_layer_get_texture (layer); CoglTexture *texture = _cogl_texture_pointer_from_handle (texture_handle); - CoglFixed *in_tex_coords = &user_tex_coords[i * 4]; + const CoglFixed *in_tex_coords = &user_tex_coords[i * 4]; GLfloat *out_tex_coords = &tex_coords_buff[i * 8]; GLuint gl_tex_handle; GLenum gl_target;