From 7c5aea9b688e7fb3d57cd5a8c5bf2b8095f5f71a Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 2 Dec 2009 17:17:24 +0000 Subject: [PATCH] cogl: Make the callback for foreach_sub_texture_in_region use const The CoglTextureSliceCallback function pointer now takes const pointers for the texture coordinates. This makes it clearer that the callback should not modify the array and therefore the backend can use the same array for both sets of coords. --- cogl/cogl-journal-private.h | 2 +- cogl/cogl-journal.c | 2 +- cogl/cogl-primitives.c | 14 +++++++------- cogl/cogl-texture-private.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cogl/cogl-journal-private.h b/cogl/cogl-journal-private.h index dc008f67a..a410c8ff0 100644 --- a/cogl/cogl-journal-private.h +++ b/cogl/cogl-journal-private.h @@ -51,7 +51,7 @@ _cogl_journal_log_quad (float x_1, int n_layers, guint32 fallback_layers, GLuint layer0_override_texture, - float *tex_coords, + const float *tex_coords, unsigned int tex_coords_len); #endif /* __COGL_JOURNAL_PRIVATE_H */ diff --git a/cogl/cogl-journal.c b/cogl/cogl-journal.c index db406ea9c..e05068365 100644 --- a/cogl/cogl-journal.c +++ b/cogl/cogl-journal.c @@ -631,7 +631,7 @@ _cogl_journal_log_quad (float x_1, int n_layers, guint32 fallback_layers, GLuint layer0_override_texture, - float *tex_coords, + const float *tex_coords, unsigned int tex_coords_len) { size_t stride; diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c index 4a614e1c5..58fec0240 100644 --- a/cogl/cogl-primitives.c +++ b/cogl/cogl-primitives.c @@ -71,8 +71,8 @@ static void log_quad_sub_textures_cb (CoglHandle texture_handle, GLuint gl_handle, GLenum gl_target, - float *subtexture_coords, - float *virtual_coords, + const float *subtexture_coords, + const float *virtual_coords, void *user_data) { TextureSlicedQuadState *state = user_data; @@ -638,11 +638,11 @@ cogl_rectangle (float x_1, void draw_polygon_sub_texture_cb (CoglHandle tex_handle, - GLuint gl_handle, - GLenum gl_target, - float *subtexture_coords, - float *virtual_coords, - void *user_data) + GLuint gl_handle, + GLenum gl_target, + const float *subtexture_coords, + const float *virtual_coords, + void *user_data) { TextureSlicedPolygonState *state = user_data; GLfloat *v; diff --git a/cogl/cogl-texture-private.h b/cogl/cogl-texture-private.h index 9ea5fbfb2..ee018faf4 100644 --- a/cogl/cogl-texture-private.h +++ b/cogl/cogl-texture-private.h @@ -37,8 +37,8 @@ typedef struct _CoglTextureUploadData CoglTextureUploadData; typedef void (*CoglTextureSliceCallback) (CoglHandle handle, GLuint gl_handle, GLenum gl_target, - float *slice_coords, - float *virtual_coords, + const float *slice_coords, + const float *virtual_coords, void *user_data); typedef void (* CoglTextureManualRepeatCallback) (const float *coords,