[_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.
This commit is contained in:
Robert Bragg 2009-06-08 17:43:34 +01:00
parent 6414adbfeb
commit 9d82995773
2 changed files with 4 additions and 0 deletions

View File

@ -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 */

View File

@ -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 */