From f5a8e693c81e85ba4d68d7d081ed0f4920af3662 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Fri, 19 Jun 2009 16:39:37 +0100 Subject: [PATCH] [cogl-texture] use the right format when downloading sliced textures from GL _cogl_texture_download_from_gl needs to create transient CoglBitmaps when downloading sliced textures from GL, and then copies these as subregions into the final target_bitmap. _cogl_texture_download_from_gl also supports target_bitmaps with a different format to the source CoglTexture being downloaded. The problem was that in the case of slice textures we were always looking at the format of the CoglTexture, not of the target_bitmap when setting up the transient slice bitmap. --- gl/cogl-texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gl/cogl-texture.c b/gl/cogl-texture.c index 7e689a50a..fb118c707 100644 --- a/gl/cogl-texture.c +++ b/gl/cogl-texture.c @@ -397,7 +397,7 @@ _cogl_texture_download_from_gl (CoglTexture *tex, if (y_span->waste != 0 || x_span->waste != 0) { /* Setup temp bitmap for slice subregion */ - slice_bmp.format = tex->bitmap.format; + slice_bmp.format = target_bmp->format; slice_bmp.width = x_span->size; slice_bmp.height = y_span->size; slice_bmp.rowstride = bpp * slice_bmp.width;