Fix checks for out-of-bounds coordinates and repeats

Add a return result from CoglTexture.transform_quad_coords_to_gl(),
so that we can properly determine the nature of repeats in
the face of GL_TEXTURE_RECTANGLE_ARB, where the returned
coordinates are not normalized.

The comment "We also work out whether any of the texture
coordinates are outside the range [0.0,1.0]. We need to do
this after calling transform_coords_to_gl in case the texture
backend is munging the coordinates (such as in the sub texture
backend)." is disregarded and removed, since it's actually
the virtual coordinates that determine whether we repeat,
not the GL coordinates.

Warnings about disregarded layers are used in all cases where
applicable, including for subtextures.

http://bugzilla.openedhand.com/show_bug.cgi?id=2016

Signed-off-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Owen W. Taylor
2010-03-01 16:49:04 -05:00
committed by Neil Roberts
parent ec9adfd1d4
commit 770ca1311d
7 changed files with 66 additions and 42 deletions

View File

@ -337,7 +337,7 @@ _cogl_sub_texture_transform_coords_to_gl (CoglTexture *tex,
_cogl_texture_transform_coords_to_gl (sub_tex->full_texture, s, t);
}
static gboolean
static CoglTransformResult
_cogl_sub_texture_transform_quad_coords_to_gl (CoglTexture *tex,
float *coords)
{
@ -348,13 +348,12 @@ _cogl_sub_texture_transform_quad_coords_to_gl (CoglTexture *tex,
cogl-primitives will resort to manual repeating */
for (i = 0; i < 4; i++)
if (coords[i] < 0.0f || coords[i] > 1.0f)
return FALSE;
return COGL_TRANSFORM_SOFTWARE_REPEAT;
_cogl_sub_texture_map_quad (sub_tex, coords);
_cogl_texture_transform_quad_coords_to_gl (sub_tex->full_texture, coords);
return TRUE;
return _cogl_texture_transform_quad_coords_to_gl (sub_tex->full_texture,
coords);
}
static gboolean