[cogl/cogl-1.18] offscreen: allocate texture before querying slicing



commit a07d26e9ae52ac1e4f5d3533a61e950f53a927b9
Author: Robert Bragg <robert linux intel com>
Date:   Thu Jun 27 03:11:47 2013 +0100

    offscreen: allocate texture before querying slicing
    
    Since we are planning on deferring more texture allocation work this
    makes sure we don't query whether a texture is sliced until we know it
    has been allocated.
    
    Reviewed-by: Neil Roberts <neil linux intel com>
    (cherry picked from commit b742638a1ce581f5a2c9f15907361c3b0c1b178c)

 cogl/cogl-framebuffer.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index cf9b20d..6b9db04 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -734,6 +734,11 @@ cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
           return FALSE;
         }
 
+      if (!cogl_texture_allocate (offscreen->texture, error))
+        return FALSE;
+
+      /* NB: it's only after allocating the texture that we will
+       * determine whether a texture needs slicing... */
       if (cogl_texture_is_sliced (offscreen->texture))
         {
           _cogl_set_error (error, COGL_SYSTEM_ERROR,
@@ -743,9 +748,6 @@ cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
           return FALSE;
         }
 
-      if (!cogl_texture_allocate (offscreen->texture, error))
-        return FALSE;
-
       /* Forward the texture format as the internal format of the
        * framebuffer */
       framebuffer->internal_format =


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]