[cogl/cogl-1.18] ensure texture allocated in _get_gl_texture() in preparation



commit b9093839b4186aed8752dd3e9f1b1a32af868e42
Author: Robert Bragg <robert linux intel com>
Date:   Wed Jun 26 22:50:11 2013 +0100

    ensure texture allocated in _get_gl_texture() in preparation
    
    The plan is to defer a lot more work in creating a texture until
    allocation time. This means we wont be able to assume that all textures
    being used to render must have already been allocated when data was
    specified.
    
    The latest point at which we will generally require a texture to be
    allocated will be when we need to know the underlying GL handle for a
    texture and so this updates cogl_texture_get_gl_texture() to ensure the
    texture is allocated.
    
    Reviewed-by: Neil Roberts <neil linux intel com>
    (cherry picked from commit 59f6fefc37524f492512a71b831760a218d9bb95)

 cogl/cogl-texture.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c
index 1e9df8c..b82d610 100644
--- a/cogl/cogl-texture.c
+++ b/cogl/cogl-texture.c
@@ -345,6 +345,9 @@ cogl_texture_get_gl_texture (CoglTexture *texture,
                             GLuint *out_gl_handle,
                             GLenum *out_gl_target)
 {
+  if (!texture->allocated)
+    cogl_texture_allocate (texture, NULL);
+
   return texture->vtable->get_gl_texture (texture,
                                           out_gl_handle, out_gl_target);
 }


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