[cogl/wip/lazy-texture-allocate: 2/13] offscreen: allocate texture before querying slicing



commit 2622fdf008ada0833f2b3d8fe33bbc0aeef0a1dd
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.

 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 626e8b3..b7a3441 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -681,6 +681,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,
@@ -690,9 +695,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]