summaryrefslogtreecommitdiff
path: root/cogl/cogl.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-03-01 13:55:39 +0000
committerNeil Roberts <neil@linux.intel.com>2012-03-05 17:44:52 +0000
commitf4cd5aceb923bc984a97f73a7ac4a5a9c588bb28 (patch)
treed78e3c2ba59d486a6b24c2605486d0bce28f1db7 /cogl/cogl.c
parent8ce5f5ade895c7f9f7d266a56ef25ae9596ef787 (diff)
downloadcogl-f4cd5aceb923bc984a97f73a7ac4a5a9c588bb28.tar.gz
_cogl_bitmap_convert: Also handle premult conversions
If we are going to unpack the data into a known format anyway we might as well do the premult conversion instead of delaying it to do in-place. This helps because not all formats with alpha channels are handled by the in-place premult conversion code. This removes the _cogl_bitmap_convert_format_and_premult function so that now _cogl_bitmap_convert is a completely general purpose function that can convert from anything to anything. _cogl_bitmap_convert now includes a fast path for when the base formats are the same and the premult conversion can be handled with the in-place code so that we don't need to unpack and can just copy the bitmap instead. Reviewed-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'cogl/cogl.c')
-rw-r--r--cogl/cogl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/cogl/cogl.c b/cogl/cogl.c
index f9aa3ca6..97645782 100644
--- a/cogl/cogl.c
+++ b/cogl/cogl.c
@@ -503,8 +503,7 @@ _cogl_read_pixels_with_rowstride (int x,
/* CoglBitmap doesn't currently have a way to convert without
allocating its own buffer so we have to copy the data
again */
- if ((dst_bmp = _cogl_bitmap_convert_format_and_premult (tmp_bmp,
- format)))
+ if ((dst_bmp = _cogl_bitmap_convert (tmp_bmp, format)))
{
_cogl_bitmap_copy_subregion (dst_bmp,
bmp,