console: avoid unneeded matrix transformations

We now assume a screen of -1,-1 to 1,1 instead of 0,0 to 1,1 to avoid
matrix transformations.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-04-22 16:38:53 +02:00
parent 0310a4c054
commit 6c23507910
2 changed files with 3 additions and 4 deletions

View File

@ -768,8 +768,6 @@ static void kmscon_buffer_draw(struct kmscon_buffer *buf,
}
gl_m4_identity(m);
gl_m4_translate(m, -1, -1, 0);
gl_m4_scale(m, 2, 2, 1);
font_screen_draw_perform(fscr, m);
}

View File

@ -729,14 +729,15 @@ int font_screen_draw_char(struct font_screen *screen, kmscon_symbol_t ch,
int font_screen_draw_perform(struct font_screen *screen, float *m)
{
static const float val[] = { 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1 };
static const float ver[] = { -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1 };
static const float tex[] = { 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1 };
if (!screen)
return -EINVAL;
gl_tex_load(screen->tex, screen->buf->width, screen->buf->stride,
screen->buf->height, screen->buf->data);
gl_shader_draw_tex(screen->shader, val, val, 6, screen->tex, m);
gl_shader_draw_tex(screen->shader, ver, tex, 6, screen->tex, m);
cairo_restore(screen->cr);
return 0;