mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-04 09:48:15 +02:00
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:
parent
e845450905
commit
fcd29473ff
1 changed files with 10 additions and 6 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue