From 101b88192d21c17fe7a72349881e400705216a29 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 8 Jun 2009 17:43:34 +0100 Subject: [PATCH] [_cogl_texture_bitmap_prepare] use bitmap format for FORMAT_ANY + no alpha My patch to choose a premultiplied format when the user gives COGL_PIXEL_FORMAT_ANY for the internal_format broke the case where the data in question doesn't have and alpha channel. This was accidentally missed when merging the premultiplication branch since I merged a local version of the branch that missed this commit. --- gl/cogl-texture.c | 2 ++ gles/cogl-texture.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/gl/cogl-texture.c b/gl/cogl-texture.c index 877107d3c..7e689a50a 100644 --- a/gl/cogl-texture.c +++ b/gl/cogl-texture.c @@ -1197,6 +1197,8 @@ _cogl_texture_bitmap_prepare (CoglTexture *tex, if ((tex->bitmap.format & COGL_A_BIT) && tex->bitmap.format != COGL_PIXEL_FORMAT_A_8) internal_format = tex->bitmap.format | COGL_PREMULT_BIT; + else + internal_format = tex->bitmap.format; } /* Find closest format accepted by GL */ diff --git a/gles/cogl-texture.c b/gles/cogl-texture.c index ab1653e07..5070b785c 100644 --- a/gles/cogl-texture.c +++ b/gles/cogl-texture.c @@ -1273,6 +1273,8 @@ _cogl_texture_bitmap_prepare (CoglTexture *tex, if ((tex->bitmap.format & COGL_A_BIT) && tex->bitmap.format != COGL_PIXEL_FORMAT_A_8) internal_format = tex->bitmap.format | COGL_PREMULT_BIT; + else + internal_format = tex->bitmap.format; } /* Find closest format accepted by GL */