[cogl/cogl-1.18] texture: allocate on slicing/hw repeat queries
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.18] texture: allocate on slicing/hw repeat queries
- Date: Thu, 9 Jan 2014 16:00:58 +0000 (UTC)
commit 40c6b1cc2941a718e1d924073e447955ae757c50
Author: Robert Bragg <robert linux intel com>
Date: Sun Jun 30 17:16:58 2013 +0100
texture: allocate on slicing/hw repeat queries
The plan is to defer a lot more work in creating a texture until
allocation time. This means that for some texture backends we might not
know until after allocation whether the texture is sliced or can support
hardware repeating. This makes sure we trigger an allocation if either
of these are queried.
Reviewed-by: Neil Roberts <neil linux intel com>
(cherry picked from commit 4868582812dbcd5125495b312d858f751fc31e9d)
cogl/cogl-texture.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c
index b82d610..09da3af 100644
--- a/cogl/cogl-texture.c
+++ b/cogl/cogl-texture.c
@@ -229,6 +229,8 @@ cogl_texture_get_height (CoglTexture *texture)
CoglPixelFormat
cogl_texture_get_format (CoglTexture *texture)
{
+ if (!texture->allocated)
+ cogl_texture_allocate (texture, NULL);
return texture->vtable->get_format (texture);
}
@@ -309,6 +311,8 @@ _cogl_texture_get_level_size (CoglTexture *texture,
CoglBool
cogl_texture_is_sliced (CoglTexture *texture)
{
+ if (!texture->allocated)
+ cogl_texture_allocate (texture, NULL);
return texture->vtable->is_sliced (texture);
}
@@ -319,6 +323,8 @@ cogl_texture_is_sliced (CoglTexture *texture)
CoglBool
_cogl_texture_can_hardware_repeat (CoglTexture *texture)
{
+ if (!texture->allocated)
+ cogl_texture_allocate (texture, NULL);
return texture->vtable->can_hardware_repeat (texture);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]