summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-04-25 09:46:43 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-04-29 18:37:41 -0600
commit4e0e02ae684c0286599309ae166cfc716db940d7 (patch)
tree9887da2b66ae173f11126c023339779970a53aa7 /src/mesa
parent4f474c7d1e1e6807af0f3db55f641fbd66be2e90 (diff)
mesa: adjust glBitmap coords by a small epsilon
Fixes problem with bitmaps jumping around by one pixel depending on window size. The rasterpos is often X.9999 instead of X+1. Run progs/redbook/drawf and resize window to check. Cherry picked from gallium-0.1 branch
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/drawpix.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index 4f28766674..fde9338430 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -374,8 +374,9 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
if (ctx->RenderMode == GL_RENDER) {
/* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */
- GLint x = IFLOOR(ctx->Current.RasterPos[0] - xorig);
- GLint y = IFLOOR(ctx->Current.RasterPos[1] - yorig);
+ const GLfloat epsilon = 0.0001;
+ GLint x = IFLOOR(ctx->Current.RasterPos[0] + epsilon - xorig);
+ GLint y = IFLOOR(ctx->Current.RasterPos[1] + epsilon - yorig);
if (ctx->Unpack.BufferObj->Name) {
/* unpack from PBO */