mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
take GL_UNPACK_ALIGNMENT into account in _mesa_image_row_stride() for GL_BITMAP type (bug 10261)
This commit is contained in:
parent
d0a3400f66
commit
c1a5447337
1 changed files with 6 additions and 1 deletions
|
|
@ -667,7 +667,7 @@ _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing,
|
|||
ASSERT(packing);
|
||||
if (type == GL_BITMAP) {
|
||||
/* BITMAP data */
|
||||
GLint bytes;
|
||||
GLint bytes, remainder;
|
||||
if (packing->RowLength == 0) {
|
||||
bytes = (width + 7) / 8;
|
||||
}
|
||||
|
|
@ -678,6 +678,11 @@ _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing,
|
|||
/* negate the bytes per row (negative row stride) */
|
||||
bytes = -bytes;
|
||||
}
|
||||
|
||||
remainder = bytes % packing->Alignment;
|
||||
if (remainder > 0)
|
||||
bytes += (packing->Alignment - remainder);
|
||||
|
||||
return bytes;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue