summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2013-06-30 17:16:58 +0100
committerRobert Bragg <robert@linux.intel.com>2013-12-02 15:31:19 +0000
commitdaf209899fa0ce04ed06c63c60da56a966e7b0ff (patch)
treeb9a8c716f5867faebf430b8e6f77944351373582
parenta8480eddca6d325fa768af89205dbf743bb06236 (diff)
downloadcogl-daf209899fa0ce04ed06c63c60da56a966e7b0ff.tar.gz
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.
-rw-r--r--cogl/cogl-texture.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c
index ec6b7100..515fb43a 100644
--- a/cogl/cogl-texture.c
+++ b/cogl/cogl-texture.c
@@ -185,6 +185,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);
}
@@ -246,6 +248,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);
}
@@ -256,6 +260,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);
}