[cogl/cogl-1.14] Don't handle the out-of-memory error specially for auto-textures
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.14] Don't handle the out-of-memory error specially for auto-textures
- Date: Fri, 14 Jun 2013 10:34:31 +0000 (UTC)
commit c6171434e0ce905fee3a6ea22c804459d69c4524
Author: Neil Roberts <neil linux intel com>
Date: Thu Jun 13 17:18:18 2013 +0100
Don't handle the out-of-memory error specially for auto-textures
Previously when trying the three different texture types to create an
automagic texture it would handle the out-of-memory error specially
and bypass trying the remaining texture types. Presumably the idea is
that out-of-memory is a serious error and it can't be recovered from.
However, in the case of atlas textures, this error will be thrown if
the texture is too large to fit into an atlas. In that case it makes
sense to try another texture type so that it can fallback to using a
sliced texture. I think conceptually each different texture type will
have different memory requirements so it seems reasonable to try the
others if there is not enough memory for one of them.
This was causing cogl_texture_new_from_data to break when loading very
large textures because it wouldn't end up slicing them.
Reviewed-by: Robert Bragg <robert linux intel com>
(cherry picked from commit ad6968135a01823eb6a94668dd22c7a4df6f9327)
cogl/cogl-auto-texture.c | 16 ----------------
1 files changed, 0 insertions(+), 16 deletions(-)
---
diff --git a/cogl/cogl-auto-texture.c b/cogl/cogl-auto-texture.c
index 6de2e32..9a5819d 100644
--- a/cogl/cogl-auto-texture.c
+++ b/cogl/cogl-auto-texture.c
@@ -179,14 +179,6 @@ _cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
&internal_error)))
return COGL_TEXTURE (atlas_tex);
- if (cogl_error_matches (internal_error,
- COGL_SYSTEM_ERROR,
- COGL_SYSTEM_ERROR_NO_MEMORY))
- {
- _cogl_propagate_error (error, internal_error);
- return NULL;
- }
-
cogl_error_free (internal_error);
internal_error = NULL;
@@ -200,14 +192,6 @@ _cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
internal_format,
&internal_error));
- if (cogl_error_matches (internal_error,
- COGL_SYSTEM_ERROR,
- COGL_SYSTEM_ERROR_NO_MEMORY))
- {
- _cogl_propagate_error (error, internal_error);
- return NULL;
- }
-
if (!tex)
{
cogl_error_free (internal_error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]