projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
texenv: Match state.c in deciding whether we'll be using a vertex shader.
[mesa.git]
/
src
/
mesa
/
main
/
image.c
diff --git
a/src/mesa/main/image.c
b/src/mesa/main/image.c
index ddae456fa129b4b4c6f03bb80ed415c20d05c90d..01fbe40a03b418f72ef98f9d1f81246dfaf0b9b7 100644
(file)
--- a/
src/mesa/main/image.c
+++ b/
src/mesa/main/image.c
@@
-1,8
+1,9
@@
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
- * Version: 7.
1
+ * Version: 7.
5
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@
-755,12
+756,20
@@
_mesa_image_image_stride( const struct gl_pixelstore_attrib *packing,
GLint width, GLint height,
GLenum format, GLenum type )
{
GLint width, GLint height,
GLenum format, GLenum type )
{
+ GLint bytesPerRow, bytesPerImage, remainder;
+
ASSERT(packing);
ASSERT(packing);
- ASSERT(type != GL_BITMAP);
- {
+ if (type == GL_BITMAP) {
+ if (packing->RowLength == 0) {
+ bytesPerRow = (width + 7) / 8;
+ }
+ else {
+ bytesPerRow = (packing->RowLength + 7) / 8;
+ }
+ }
+ else {
const GLint bytesPerPixel = _mesa_bytes_per_pixel(format, type);
const GLint bytesPerPixel = _mesa_bytes_per_pixel(format, type);
- GLint bytesPerRow, bytesPerImage, remainder;
if (bytesPerPixel <= 0)
return -1; /* error */
if (bytesPerPixel <= 0)
return -1; /* error */
@@
-770,17
+779,18
@@
_mesa_image_image_stride( const struct gl_pixelstore_attrib *packing,
else {
bytesPerRow = bytesPerPixel * packing->RowLength;
}
else {
bytesPerRow = bytesPerPixel * packing->RowLength;
}
- remainder = bytesPerRow % packing->Alignment;
- if (remainder > 0)
- bytesPerRow += (packing->Alignment - remainder);
+ }
- if (packing->ImageHeight == 0)
- bytesPerImage = bytesPerRow * height;
- else
- bytesPerImage = bytesPerRow * packing->ImageHeight;
+ remainder = bytesPerRow % packing->Alignment;
+ if (remainder > 0)
+ bytesPerRow += (packing->Alignment - remainder);
- return bytesPerImage;
- }
+ if (packing->ImageHeight == 0)
+ bytesPerImage = bytesPerRow * height;
+ else
+ bytesPerImage = bytesPerRow * packing->ImageHeight;
+
+ return bytesPerImage;
}
}
@@
-2862,7
+2872,7
@@
extract_uint_indexes(GLuint n, GLuint indexes[],
}
else {
for (i = 0; i < n; i++)
}
else {
for (i = 0; i < n; i++)
- indexes[i] = s[i] & 0xff
f
; /* lower 8 bits */
+ indexes[i] = s[i] & 0xff; /* lower 8 bits */
}
}
break;
}
}
break;