mesa: Branch 'master'
Haihao Xiang
haihao at kemper.freedesktop.org
Wed Mar 21 03:04:35 UTC 2007
src/mesa/main/image.c | 19 +++++--------------
src/mesa/main/mtypes.h | 1 -
src/mesa/main/texstore.c | 2 +-
3 files changed, 6 insertions(+), 16 deletions(-)
New commits:
diff-tree 704cd61120443501530279937a144a5dd4b6399e (from 4bafc547df4af0b560dcc6b72c0a6c37d7754abb)
Author: Xiang, Haihao <haihao.xiang at intel.com>
Date: Wed Mar 21 10:50:19 2007 +0800
mesa: revert f9f79c8d770e696249bd98c68b563f887562c974
to fix #10232
Table6.1(in gl2.1) has been applied for glGetTexImage
before calling into _mesa_pack_rgba_span_float.
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 44729b7..394a7c6 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1211,24 +1211,15 @@ _mesa_pack_rgba_span_float(GLcontext *ct
if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) {
/* compute luminance values */
- if (transferOps & IMAGE_RED_TO_LUMINANCE) {
- /* Luminance = Red (glGetTexImage) */
+ if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) {
for (i = 0; i < n; i++) {
- luminance[i] = rgba[i][RCOMP];
+ GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
+ luminance[i] = CLAMP(sum, 0.0F, 1.0F);
}
}
else {
- /* Luminance = Red + Green + Blue (glReadPixels) */
- if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) {
- for (i = 0; i < n; i++) {
- GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
- luminance[i] = CLAMP(sum, 0.0F, 1.0F);
- }
- }
- else {
- for (i = 0; i < n; i++) {
- luminance[i] = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
- }
+ for (i = 0; i < n; i++) {
+ luminance[i] = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
}
}
}
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 65246eb..df77c6c 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2562,7 +2562,6 @@ struct matrix_stack
#define IMAGE_HISTOGRAM_BIT 0x200
#define IMAGE_MIN_MAX_BIT 0x400
#define IMAGE_CLAMP_BIT 0x800 /* extra */
-#define IMAGE_RED_TO_LUMINANCE 0x1000
/** Pixel Transfer ops up to convolution */
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 2098bdd..a570525 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -3630,7 +3630,7 @@ _mesa_get_teximage(GLcontext *ctx, GLenu
}
_mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba,
format, type, dest,
- &ctx->Pack, IMAGE_RED_TO_LUMINANCE);
+ &ctx->Pack, 0x0 /*image xfer ops*/);
} /* format */
} /* row */
} /* img */
More information about the mesa-commit
mailing list