From 41cd2ae2c84f2e217cebb632d303a16fbb7a9fb5 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 14 Jul 2010 13:21:54 +0100 Subject: [PATCH] cogl-texture-2d-sliced: Store the internal format not image format The 'format' member of CoglTexture2DSliced is returned by cogl_texture_get_format. All of the other backends return the internal format of the GL texture in this case. However the sliced backend was returning the format of the image data used to create the texture. It doesn't make any sense to retain this information because it doesn't necessarily indicate the format of the actual texture. This patch changes it to store the internal format instead. --- cogl/cogl-texture-2d-sliced.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cogl/cogl-texture-2d-sliced.c b/cogl/cogl-texture-2d-sliced.c index 0cf243062..2161144c7 100644 --- a/cogl/cogl-texture-2d-sliced.c +++ b/cogl/cogl-texture-2d-sliced.c @@ -986,10 +986,10 @@ _cogl_texture_2d_sliced_upload_from_data else { /* Find closest GL format match */ - _cogl_pixel_format_to_gl (internal_format, - &gl_intformat, - &gl_format, - &gl_type); + internal_format = _cogl_pixel_format_to_gl (internal_format, + &gl_intformat, + &gl_format, + &gl_type); /* Create slices for the given format and size */ if (!_cogl_texture_2d_sliced_slices_create (tex_2ds, @@ -1004,7 +1004,7 @@ _cogl_texture_2d_sliced_upload_from_data tex_2ds->gl_format = gl_intformat; tex_2ds->width = bmp->width; tex_2ds->height = bmp->height; - tex_2ds->format = bmp->format; + tex_2ds->format = internal_format; return TRUE; }