From 4650b35846e8e87fb0d74573a5f66452bb449b4b Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 5 Feb 2008 16:32:15 -0700 Subject: gallium: add bitmap/drawpixels texcoord bias support The state tracker will call pipe->get_paramf(PIPE_CAP_BITMAP_TEXCOORD_BIAS) to get a bias factor for adjusting the texcoords used in bitmap/drawpixels. This allows us to compensate for small differences in rasterization from one device to another. --- src/mesa/state_tracker/st_cb_drawpixels.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa/state_tracker/st_cb_drawpixels.c') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 6b44cba2e4..34d420fcff 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -581,10 +581,13 @@ draw_quad_colored(GLcontext *ctx, GLfloat x0, GLfloat y0, GLfloat z, GLfloat x1, GLfloat y1, const GLfloat *color, GLboolean invertTex) { + GLfloat bias = ctx->st->bitmap_texcoord_bias; GLfloat verts[4][3][4]; /* four verts, three attribs, XYZW */ GLuint i; - GLfloat sLeft = 0.0, sRight = 1.0; - GLfloat tTop = invertTex, tBot = 1.0 - tTop; + GLfloat xBias = bias / (x1-x0); + GLfloat yBias = bias / (y1-y0); + GLfloat sLeft = 0.0 + xBias, sRight = 1.0 + xBias; + GLfloat tTop = invertTex - yBias, tBot = 1.0 - tTop - yBias; /* upper-left */ verts[0][0][0] = x0; /* attr[0].x */ -- cgit v1.2.3