summaryrefslogtreecommitdiff
path: root/cogl/cogl-bitmap.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-03-01 13:14:10 +0000
committerNeil Roberts <neil@linux.intel.com>2012-03-05 17:44:52 +0000
commit8ce5f5ade895c7f9f7d266a56ef25ae9596ef787 (patch)
treee7ef8ccc753983be9c8ef2b45b9ab4f978b9d105 /cogl/cogl-bitmap.c
parentb85f2e907a38b6a6f19e5356a682bb72453bb11e (diff)
downloadcogl-8ce5f5ade895c7f9f7d266a56ef25ae9596ef787.tar.gz
bitmap: Remove the split between 'image library' and 'fallback'
Previously the bitmap code was setup so that there could be an image library used to convert between formats and then some 'fallback' code when the image library can't handle the conversion. However there was never any implementation of the conversion in the image library so the fallback was always used. I don't think this split really makes sense so this patch renames cogl-bitmap-fallback to cogl-bitmap-conversion and removes the stub conversion functions in the image library. Reviewed-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'cogl/cogl-bitmap.c')
-rw-r--r--cogl/cogl-bitmap.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/cogl/cogl-bitmap.c b/cogl/cogl-bitmap.c
index bb178ce0..46930dee 100644
--- a/cogl/cogl-bitmap.c
+++ b/cogl/cogl-bitmap.c
@@ -87,19 +87,14 @@ _cogl_bitmap_convert_premult_status (CoglBitmap *bmp,
if ((bmp->format & COGL_PREMULT_BIT) > 0 &&
(dst_format & COGL_PREMULT_BIT) == 0 &&
COGL_PIXEL_FORMAT_CAN_HAVE_PREMULT (dst_format))
- /* Try unpremultiplying using imaging library */
- return (_cogl_bitmap_unpremult (bmp)
- /* ... or try fallback */
- || _cogl_bitmap_fallback_unpremult (bmp));
+ return _cogl_bitmap_unpremult (bmp);
/* Do we need to premultiply? */
if ((bmp->format & COGL_PREMULT_BIT) == 0 &&
COGL_PIXEL_FORMAT_CAN_HAVE_PREMULT (bmp->format) &&
(dst_format & COGL_PREMULT_BIT) > 0)
/* Try premultiplying using imaging library */
- return (_cogl_bitmap_premult (bmp)
- /* ... or try fallback */
- || _cogl_bitmap_fallback_premult (bmp));
+ return _cogl_bitmap_premult (bmp);
return TRUE;
}
@@ -115,14 +110,8 @@ _cogl_bitmap_convert_format_and_premult (CoglBitmap *bmp,
if ((src_format & ~COGL_PREMULT_BIT) !=
(dst_format & ~COGL_PREMULT_BIT))
{
- /* Try converting using imaging library */
if ((dst_bmp = _cogl_bitmap_convert (bmp, dst_format)) == NULL)
- {
- /* ... or try fallback */
- if ((dst_bmp = _cogl_bitmap_fallback_convert (bmp,
- dst_format)) == NULL)
- return NULL;
- }
+ return NULL;
}
else
{
@@ -292,22 +281,9 @@ CoglBitmap *
cogl_bitmap_new_from_file (const char *filename,
GError **error)
{
- CoglBitmap *bmp;
-
_COGL_RETURN_VAL_IF_FAIL (error == NULL || *error == NULL, COGL_INVALID_HANDLE);
- if ((bmp = _cogl_bitmap_from_file (filename, error)) == NULL)
- {
- /* Try fallback */
- if ((bmp = _cogl_bitmap_fallback_from_file (filename))
- && error && *error)
- {
- g_error_free (*error);
- *error = NULL;
- }
- }
-
- return bmp;
+ return _cogl_bitmap_from_file (filename, error);
}
CoglBitmap *