diff options
author | Iago Toral Quiroga <[email protected]> | 2014-11-27 09:29:44 +0100 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2015-01-12 11:20:30 +0100 |
commit | 769de5165c71315d66bab2bc27be98ec481ea9f8 (patch) | |
tree | 9f622322bc12889c8572754f1c47aae8e9e190de /src/mesa/main | |
parent | 8993b9818c1f2968f674a6945aa0bc929709f47d (diff) |
mesa: Remove _mesa_rebase_rgba_uint and _mesa_rebase_rgba_float
These are no longer used anywhere now that we have _mesa_format_convert.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/pack.c | 126 | ||||
-rw-r--r-- | src/mesa/main/pack.h | 7 |
2 files changed, 0 insertions, 133 deletions
diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index e59ea5940fb..be8bc6cd92a 100644 --- a/src/mesa/main/pack.c +++ b/src/mesa/main/pack.c @@ -1325,132 +1325,6 @@ _mesa_unpack_image( GLuint dimensions, } } - - -/** - * If we unpack colors from a luminance surface, we'll get pixel colors - * such as (l, l, l, a). - * When we call _mesa_pack_rgba_span_float(format=GL_LUMINANCE), that - * function will compute L=R+G+B before packing. The net effect is we'll - * accidentally store luminance values = 3*l. - * This function compensates for that by converting (aka rebasing) (l,l,l,a) - * to be (l,0,0,a). - * It's a similar story for other formats such as LUMINANCE_ALPHA, ALPHA - * and INTENSITY. - * - * Finally, we also need to do this when the actual surface format does - * not match the logical surface format. For example, suppose the user - * requests a GL_LUMINANCE texture but the driver stores it as RGBA. - * Again, we'll get pixel values like (l,l,l,a). - */ -void -_mesa_rebase_rgba_float(GLuint n, GLfloat rgba[][4], GLenum baseFormat) -{ - GLuint i; - - switch (baseFormat) { - case GL_ALPHA: - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = 0.0F; - rgba[i][GCOMP] = 0.0F; - rgba[i][BCOMP] = 0.0F; - } - break; - case GL_INTENSITY: - /* fall-through */ - case GL_LUMINANCE: - for (i = 0; i < n; i++) { - rgba[i][GCOMP] = 0.0F; - rgba[i][BCOMP] = 0.0F; - rgba[i][ACOMP] = 1.0F; - } - break; - case GL_LUMINANCE_ALPHA: - for (i = 0; i < n; i++) { - rgba[i][GCOMP] = 0.0F; - rgba[i][BCOMP] = 0.0F; - } - break; - case GL_RGB: - for (i = 0; i < n; i++) { - rgba[i][ACOMP] = 1.0F; - } - break; - case GL_RG: - for (i = 0; i < n; i++) { - rgba[i][BCOMP] = 0.0F; - rgba[i][ACOMP] = 1.0F; - } - break; - case GL_RED: - for (i = 0; i < n; i++) { - rgba[i][GCOMP] = 0.0F; - rgba[i][BCOMP] = 0.0F; - rgba[i][ACOMP] = 1.0F; - } - break; - - default: - /* no-op */ - ; - } -} - - -/** - * As above, but GLuint components. - */ -void -_mesa_rebase_rgba_uint(GLuint n, GLuint rgba[][4], GLenum baseFormat) -{ - GLuint i; - - switch (baseFormat) { - case GL_ALPHA: - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = 0; - rgba[i][GCOMP] = 0; - rgba[i][BCOMP] = 0; - } - break; - case GL_INTENSITY: - /* fall-through */ - case GL_LUMINANCE: - for (i = 0; i < n; i++) { - rgba[i][GCOMP] = 0; - rgba[i][BCOMP] = 0; - rgba[i][ACOMP] = 1; - } - break; - case GL_LUMINANCE_ALPHA: - for (i = 0; i < n; i++) { - rgba[i][GCOMP] = 0; - rgba[i][BCOMP] = 0; - } - break; - case GL_RGB: - for (i = 0; i < n; i++) { - rgba[i][ACOMP] = 1; - } - break; - case GL_RG: - for (i = 0; i < n; i++) { - rgba[i][BCOMP] = 0; - rgba[i][ACOMP] = 1; - } - break; - case GL_RED: - for (i = 0; i < n; i++) { - rgba[i][GCOMP] = 0; - rgba[i][BCOMP] = 0; - rgba[i][ACOMP] = 1; - } - default: - /* no-op */ - ; - } -} - void _mesa_pack_luminance_from_rgba_float(GLuint n, GLfloat rgba[][4], GLvoid *dstAddr, GLenum dst_format, diff --git a/src/mesa/main/pack.h b/src/mesa/main/pack.h index 6d1dce72e78..ac0a099e391 100644 --- a/src/mesa/main/pack.h +++ b/src/mesa/main/pack.h @@ -85,13 +85,6 @@ _mesa_unpack_image(GLuint dimensions, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *unpack); - -extern void -_mesa_rebase_rgba_float(GLuint n, GLfloat rgba[][4], GLenum baseFormat); - -extern void -_mesa_rebase_rgba_uint(GLuint n, GLuint rgba[][4], GLenum baseFormat); - extern void _mesa_pack_luminance_from_rgba_float(GLuint n, GLfloat rgba[][4], GLvoid *dstAddr, GLenum dst_format, |