summaryrefslogtreecommitdiff
path: root/src/mesa/main/image.c
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2007-07-30 16:30:32 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2007-07-30 16:30:32 +0800
commit501b5305b939ac38177dcd73ec72f4a39296e0c4 (patch)
tree4da2c2d063e37818670a0cac3720f6b5a5a1f4ab /src/mesa/main/image.c
parent775ebb696dffaf6fddc170862ecb375e6cdfcb9c (diff)
handle LSB_FIRST in _mesa_pack_bitmap by the way used in
_mesa_unpack_bitmap
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r--src/mesa/main/image.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index ba46cdc1b1..8fccd44f21 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -850,7 +850,7 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
return NULL;
}
- if (packing->SkipPixels == 0) {
+ if ((packing->SkipPixels & 7) == 0) {
_mesa_memcpy( dst, src, width_in_bytes );
if (packing->LsbFirst) {
flip_bytes( dst, width_in_bytes );
@@ -942,7 +942,7 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
if (!dst)
return;
- if (packing->SkipPixels == 0) {
+ if ((packing->SkipPixels & 7) == 0) {
_mesa_memcpy( dst, src, width_in_bytes );
if (packing->LsbFirst) {
flip_bytes( dst, width_in_bytes );
@@ -961,20 +961,20 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
if (*s & srcMask) {
*d |= dstMask;
}
- if (srcMask == 128) {
- srcMask = 1;
+ if (srcMask == 1) {
+ srcMask = 128;
s++;
}
else {
- srcMask = srcMask << 1;
+ srcMask = srcMask >> 1;
}
- if (dstMask == 1) {
- dstMask = 128;
+ if (dstMask == 128) {
+ dstMask = 1;
d++;
*d = 0;
}
else {
- dstMask = dstMask >> 1;
+ dstMask = dstMask << 1;
}
}
}