summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-02-08 16:38:28 -0700
committerBen Skeggs <skeggsb@gmail.com>2008-02-15 13:51:10 +1100
commit9b3b230bf6b5833df65d706b68e887ae3bdcf950 (patch)
treeae0a379dc19803a05959a137f803f4412c42e879 /src
parentf554db1893749043fe5b2906f7075588be178884 (diff)
checkpoint- consolidation in do_row()
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/mipmap.c42
1 files changed, 16 insertions, 26 deletions
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index 013dc3752e..c5f1c5bcbe 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -234,11 +234,11 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth,
assert(srcWidth == dstWidth || srcWidth == 2 * dstWidth);
*/
- if (datatype == CHAN_TYPE && comps == 4) {
+ if (datatype == GL_UNSIGNED_SHORT && comps == 4) {
GLuint i, j, k;
- const GLchan (*rowA)[4] = (const GLchan (*)[4]) srcRowA;
- const GLchan (*rowB)[4] = (const GLchan (*)[4]) srcRowB;
- GLchan (*dst)[4] = (GLchan (*)[4]) dstRow;
+ const GLushort (*rowA)[4] = (const GLushort (*)[4]) srcRowA;
+ const GLushort (*rowB)[4] = (const GLushort (*)[4]) srcRowB;
+ GLushort (*dst)[4] = (GLushort (*)[4]) dstRow;
for (i = j = 0, k = k0; i < (GLuint) dstWidth;
i++, j += colStride, k += colStride) {
dst[i][0] = (rowA[j][0] + rowA[k][0] +
@@ -251,11 +251,11 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth,
rowB[j][3] + rowB[k][3]) / 4;
}
}
- else if (datatype == CHAN_TYPE && comps == 3) {
+ else if (datatype == GL_UNSIGNED_SHORT && comps == 3) {
GLuint i, j, k;
- const GLchan (*rowA)[3] = (const GLchan (*)[3]) srcRowA;
- const GLchan (*rowB)[3] = (const GLchan (*)[3]) srcRowB;
- GLchan (*dst)[3] = (GLchan (*)[3]) dstRow;
+ const GLushort (*rowA)[3] = (const GLushort (*)[3]) srcRowA;
+ const GLushort (*rowB)[3] = (const GLushort (*)[3]) srcRowB;
+ GLushort (*dst)[3] = (GLushort (*)[3]) dstRow;
for (i = j = 0, k = k0; i < (GLuint) dstWidth;
i++, j += colStride, k += colStride) {
dst[i][0] = (rowA[j][0] + rowA[k][0] +
@@ -266,21 +266,21 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth,
rowB[j][2] + rowB[k][2]) / 4;
}
}
- else if (datatype == CHAN_TYPE && comps == 1) {
+ else if (datatype == GL_UNSIGNED_SHORT && comps == 1) {
GLuint i, j, k;
- const GLchan *rowA = (const GLchan *) srcRowA;
- const GLchan *rowB = (const GLchan *) srcRowB;
- GLchan *dst = (GLchan *) dstRow;
+ const GLushort *rowA = (const GLushort *) srcRowA;
+ const GLushort *rowB = (const GLushort *) srcRowB;
+ GLushort *dst = (GLushort *) dstRow;
for (i = j = 0, k = k0; i < (GLuint) dstWidth;
i++, j += colStride, k += colStride) {
dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4;
}
}
- else if (datatype == CHAN_TYPE && comps == 2) {
+ else if (datatype == GL_UNSIGNED_SHORT && comps == 2) {
GLuint i, j, k;
- const GLchan (*rowA)[2] = (const GLchan (*)[2]) srcRowA;
- const GLchan (*rowB)[2] = (const GLchan (*)[2]) srcRowB;
- GLchan (*dst)[2] = (GLchan (*)[2]) dstRow;
+ const GLushort (*rowA)[2] = (const GLushort (*)[2]) srcRowA;
+ const GLushort (*rowB)[2] = (const GLushort (*)[2]) srcRowB;
+ GLushort (*dst)[2] = (GLushort (*)[2]) dstRow;
for (i = j = 0, k = k0; i < (GLuint) dstWidth;
i++, j += colStride, k += colStride) {
dst[i][0] = (rowA[j][0] + rowA[k][0] +
@@ -299,16 +299,6 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth,
dst[i] = rowA[j] / 4 + rowA[k] / 4 + rowB[j] / 4 + rowB[k] / 4;
}
}
- else if (datatype == GL_UNSIGNED_SHORT && comps == 1) {
- GLuint i, j, k;
- const GLushort *rowA = (const GLushort *) srcRowA;
- const GLushort *rowB = (const GLushort *) srcRowB;
- GLushort *dst = (GLushort *) dstRow;
- for (i = j = 0, k = k0; i < (GLuint) dstWidth;
- i++, j += colStride, k += colStride) {
- dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4;
- }
- }
else if (datatype == GL_UNSIGNED_BYTE && comps == 4) {
GLuint i, j, k;
const GLubyte (*rowA)[4] = (const GLubyte (*)[4]) srcRowA;