summaryrefslogtreecommitdiff
path: root/src/text_gltex.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-12-21 15:30:19 +0100
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-12-21 15:30:19 +0100
commit60c2851d6446517d4b1d120bd6d28dbb529228a9 (patch)
tree4d2a9ee0be1ba15f41128c57f43b4ea80cd489ca /src/text_gltex.c
parent382e238b2f053603fe33689c651974ccfa50eef1 (diff)
text: gltex: fix y-inversion with new gbm-surfaces
The standard OpenGL surfaces are y-inverted (which we didn't implement correctly previously when using our own gbm-surfaces). Therefore, we need to flip the y-coordinates now as we use correct GL surfaces with the new drm-uterm backend. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/text_gltex.c')
-rw-r--r--src/text_gltex.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/text_gltex.c b/src/text_gltex.c
index b1b1efe..41419c0 100644
--- a/src/text_gltex.c
+++ b/src/text_gltex.c
@@ -567,28 +567,28 @@ static int gltex_draw(struct kmscon_text *txt,
atlas->cache_pos[atlas->cache_num * 2 * 6 + 0] =
gt->advance_x * posx - 1;
atlas->cache_pos[atlas->cache_num * 2 * 6 + 1] =
- gt->advance_y * posy - 1;
+ 1 - gt->advance_y * posy;
atlas->cache_pos[atlas->cache_num * 2 * 6 + 2] =
gt->advance_x * posx - 1;
atlas->cache_pos[atlas->cache_num * 2 * 6 + 3] =
- gt->advance_y * posy + gt->advance_y - 1;
+ 1 - (gt->advance_y * posy + gt->advance_y);
atlas->cache_pos[atlas->cache_num * 2 * 6 + 4] =
gt->advance_x * posx + width * gt->advance_x - 1;
atlas->cache_pos[atlas->cache_num * 2 * 6 + 5] =
- gt->advance_y * posy + gt->advance_y - 1;
+ 1 - (gt->advance_y * posy + gt->advance_y);
atlas->cache_pos[atlas->cache_num * 2 * 6 + 6] =
gt->advance_x * posx - 1;
atlas->cache_pos[atlas->cache_num * 2 * 6 + 7] =
- gt->advance_y * posy - 1;
+ 1 - gt->advance_y * posy;
atlas->cache_pos[atlas->cache_num * 2 * 6 + 8] =
gt->advance_x * posx + width * gt->advance_x - 1;
atlas->cache_pos[atlas->cache_num * 2 * 6 + 9] =
- gt->advance_y * posy + gt->advance_y - 1;
+ 1 - (gt->advance_y * posy + gt->advance_y);
atlas->cache_pos[atlas->cache_num * 2 * 6 + 10] =
gt->advance_x * posx + width * gt->advance_x - 1;
atlas->cache_pos[atlas->cache_num * 2 * 6 + 11] =
- gt->advance_y * posy - 1;
+ 1 - gt->advance_y * posy;
atlas->cache_texpos[atlas->cache_num * 2 * 6 + 0] = glyph->texoff;
atlas->cache_texpos[atlas->cache_num * 2 * 6 + 1] = 0.0;