[cogl] Don't handle the out-of-memory error specially for auto-textures



commit ad6968135a01823eb6a94668dd22c7a4df6f9327
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>

 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 6df3fc2..402cfb9 100644
--- a/cogl/cogl-auto-texture.c
+++ b/cogl/cogl-auto-texture.c
@@ -152,14 +152,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;
 
@@ -173,14 +165,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]