gl: Fix glyphs texture coordinates for ARB_texture_rectangle.

Fixes most of the text testcases to match the
ARB_texture_non_power_of_two results.
This commit is contained in:
Eric Anholt 2010-02-16 13:47:41 -08:00
parent e845450905
commit fcd29473ff

View file

@ -125,12 +125,16 @@ _cairo_gl_glyph_cache_add_glyph (cairo_gl_context_t *ctx,
glyph_private->cache = cache;
/* compute tex coords */
glyph_private->p1.x = node->x / (double) cache->width;
glyph_private->p1.y = node->y / (double) cache->height;
glyph_private->p2.x =
(node->x + glyph_surface->width) / (double) cache->width;
glyph_private->p2.y =
(node->y + glyph_surface->height) / (double) cache->height;
glyph_private->p1.x = node->x;
glyph_private->p1.y = node->y;
glyph_private->p2.x = node->x + glyph_surface->width;
glyph_private->p2.y = node->y + glyph_surface->height;
if (ctx->tex_target != GL_TEXTURE_RECTANGLE_EXT) {
glyph_private->p1.x /= cache->width;
glyph_private->p1.y /= cache->height;
glyph_private->p2.x /= cache->width;
glyph_private->p2.y /= cache->height;
}
cairo_surface_destroy (&clone->base);