From f10f5b88224ba82310fc71f9a73ae118bf28be2d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 22 Mar 2014 12:13:20 -0600 Subject: [PATCH] mesa: rename format_(un)pack.c functions to match format names (pt. 4) sed commands: s/SRGBA_UNORM8\b/A8B8G8R8_SRGB/g s/SABGR_UNORM8\b/R8G8B8A8_SRGB/g s/SARGB8\b/B8G8R8A8_SRGB/g s/XBGR8888_SRGB\b/R8G8B8X8_SRGB/g s/XRGB8888_SRGB\b/B8G8R8X8_SRGB/g s/SL_UNORM8\b/L_SRGB8/g s/SLA_UNORM8\b/L8A8_SRGB/g manually changed SRGB8 -> BGR_SRGB8 Reviewed-by: Reviewed-by: Roland Scheidegger --- src/mesa/main/format_pack.c | 56 +++++++++++++++++------------------ src/mesa/main/format_unpack.c | 32 ++++++++++---------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c index bd7c68194c6..7122b529f09 100644 --- a/src/mesa/main/format_pack.c +++ b/src/mesa/main/format_pack.c @@ -1040,7 +1040,7 @@ pack_float_ABGR2101010_UINT(const GLfloat src[4], void *dst) /* MESA_FORMAT_BGR_SRGB8 */ static void -pack_ubyte_SRGB8(const GLubyte src[4], void *dst) +pack_ubyte_BGR_SRGB8(const GLubyte src[4], void *dst) { GLubyte *d = ((GLubyte *) dst); d[2] = linear_ubyte_to_srgb_ubyte(src[RCOMP]); @@ -1049,7 +1049,7 @@ pack_ubyte_SRGB8(const GLubyte src[4], void *dst) } static void -pack_float_SRGB8(const GLfloat src[4], void *dst) +pack_float_BGR_SRGB8(const GLfloat src[4], void *dst) { GLubyte *d = ((GLubyte *) dst); d[2] = linear_float_to_srgb_ubyte(src[RCOMP]); @@ -1061,7 +1061,7 @@ pack_float_SRGB8(const GLfloat src[4], void *dst) /* MESA_FORMAT_A8B8G8R8_SRGB */ static void -pack_ubyte_SRGBA_UNORM8(const GLubyte src[4], void *dst) +pack_ubyte_A8B8G8R8_SRGB(const GLubyte src[4], void *dst) { GLuint *d = ((GLuint *) dst); GLubyte r = linear_ubyte_to_srgb_ubyte(src[RCOMP]); @@ -1071,7 +1071,7 @@ pack_ubyte_SRGBA_UNORM8(const GLubyte src[4], void *dst) } static void -pack_float_SRGBA_UNORM8(const GLfloat src[4], void *dst) +pack_float_A8B8G8R8_SRGB(const GLfloat src[4], void *dst) { GLuint *d = ((GLuint *) dst); GLubyte r, g, b, a; @@ -1086,7 +1086,7 @@ pack_float_SRGBA_UNORM8(const GLfloat src[4], void *dst) /* MESA_FORMAT_B8G8R8A8_SRGB */ static void -pack_ubyte_SARGB8(const GLubyte src[4], void *dst) +pack_ubyte_B8G8R8A8_SRGB(const GLubyte src[4], void *dst) { GLuint *d = ((GLuint *) dst); GLubyte r = linear_ubyte_to_srgb_ubyte(src[RCOMP]); @@ -1096,7 +1096,7 @@ pack_ubyte_SARGB8(const GLubyte src[4], void *dst) } static void -pack_float_SARGB8(const GLfloat src[4], void *dst) +pack_float_B8G8R8A8_SRGB(const GLfloat src[4], void *dst) { GLuint *d = ((GLuint *) dst); GLubyte r, g, b, a; @@ -1111,7 +1111,7 @@ pack_float_SARGB8(const GLfloat src[4], void *dst) /* MESA_FORMAT_R8G8B8A8_SRGB */ static void -pack_ubyte_SABGR_UNORM8(const GLubyte src[4], void *dst) +pack_ubyte_R8G8B8A8_SRGB(const GLubyte src[4], void *dst) { GLuint *d = ((GLuint *) dst); GLubyte r = linear_ubyte_to_srgb_ubyte(src[RCOMP]); @@ -1121,7 +1121,7 @@ pack_ubyte_SABGR_UNORM8(const GLubyte src[4], void *dst) } static void -pack_float_SABGR_UNORM8(const GLfloat src[4], void *dst) +pack_float_R8G8B8A8_SRGB(const GLfloat src[4], void *dst) { GLuint *d = ((GLuint *) dst); GLubyte r, g, b, a; @@ -1136,14 +1136,14 @@ pack_float_SABGR_UNORM8(const GLfloat src[4], void *dst) /* MESA_FORMAT_L_SRGB8 */ static void -pack_ubyte_SL_UNORM8(const GLubyte src[4], void *dst) +pack_ubyte_L_SRGB8(const GLubyte src[4], void *dst) { GLubyte *d = ((GLubyte *) dst); *d = linear_ubyte_to_srgb_ubyte(src[RCOMP]); } static void -pack_float_SL_UNORM8(const GLfloat src[4], void *dst) +pack_float_L_SRGB8(const GLfloat src[4], void *dst) { GLubyte *d = ((GLubyte *) dst); GLubyte l = linear_float_to_srgb_ubyte(src[RCOMP]); @@ -1154,7 +1154,7 @@ pack_float_SL_UNORM8(const GLfloat src[4], void *dst) /* MESA_FORMAT_L8A8_SRGB */ static void -pack_ubyte_SLA_UNORM8(const GLubyte src[4], void *dst) +pack_ubyte_L8A8_SRGB(const GLubyte src[4], void *dst) { GLushort *d = ((GLushort *) dst); GLubyte l = linear_ubyte_to_srgb_ubyte(src[RCOMP]); @@ -1162,7 +1162,7 @@ pack_ubyte_SLA_UNORM8(const GLubyte src[4], void *dst) } static void -pack_float_SLA_UNORM8(const GLfloat src[4], void *dst) +pack_float_L8A8_SRGB(const GLfloat src[4], void *dst) { GLushort *d = ((GLushort *) dst); GLubyte a, l = linear_float_to_srgb_ubyte(src[RCOMP]); @@ -1760,7 +1760,7 @@ pack_float_XBGR8888_SNORM(const GLfloat src[4], void *dst) */ static void -pack_float_XBGR8888_SRGB(const GLfloat src[4], void *dst) +pack_float_R8G8B8X8_SRGB(const GLfloat src[4], void *dst) { GLuint *d = (GLuint *) dst; GLubyte r = linear_float_to_srgb_ubyte(src[RCOMP]); @@ -1910,7 +1910,7 @@ pack_float_SIGNED_G16R16_UNORM(const GLfloat src[4], void *dst) */ static void -pack_float_XRGB8888_SRGB(const GLfloat src[4], void *dst) +pack_float_B8G8R8X8_SRGB(const GLfloat src[4], void *dst) { GLuint *d = (GLuint *) dst; GLubyte r = linear_float_to_srgb_ubyte(src[RCOMP]); @@ -1983,12 +1983,12 @@ _mesa_get_pack_ubyte_rgba_function(mesa_format format) table[MESA_FORMAT_S_UINT8] = NULL; /* sRGB */ - table[MESA_FORMAT_BGR_SRGB8] = pack_ubyte_SRGB8; - table[MESA_FORMAT_A8B8G8R8_SRGB] = pack_ubyte_SRGBA_UNORM8; - table[MESA_FORMAT_B8G8R8A8_SRGB] = pack_ubyte_SARGB8; - table[MESA_FORMAT_R8G8B8A8_SRGB] = pack_ubyte_SABGR_UNORM8; - table[MESA_FORMAT_L_SRGB8] = pack_ubyte_SL_UNORM8; - table[MESA_FORMAT_L8A8_SRGB] = pack_ubyte_SLA_UNORM8; + table[MESA_FORMAT_BGR_SRGB8] = pack_ubyte_BGR_SRGB8; + table[MESA_FORMAT_A8B8G8R8_SRGB] = pack_ubyte_A8B8G8R8_SRGB; + table[MESA_FORMAT_B8G8R8A8_SRGB] = pack_ubyte_B8G8R8A8_SRGB; + table[MESA_FORMAT_R8G8B8A8_SRGB] = pack_ubyte_R8G8B8A8_SRGB; + table[MESA_FORMAT_L_SRGB8] = pack_ubyte_L_SRGB8; + table[MESA_FORMAT_L8A8_SRGB] = pack_ubyte_L8A8_SRGB; /* n/a */ table[MESA_FORMAT_SRGB_DXT1] = NULL; /* pack_ubyte_SRGB_DXT1; */ table[MESA_FORMAT_SRGBA_DXT1] = NULL; /* pack_ubyte_SRGBA_DXT1; */ @@ -2148,12 +2148,12 @@ _mesa_get_pack_float_rgba_function(mesa_format format) table[MESA_FORMAT_Z_UNORM32] = NULL; table[MESA_FORMAT_S_UINT8] = NULL; - table[MESA_FORMAT_BGR_SRGB8] = pack_float_SRGB8; - table[MESA_FORMAT_A8B8G8R8_SRGB] = pack_float_SRGBA_UNORM8; - table[MESA_FORMAT_B8G8R8A8_SRGB] = pack_float_SARGB8; - table[MESA_FORMAT_R8G8B8A8_SRGB] = pack_float_SABGR_UNORM8; - table[MESA_FORMAT_L_SRGB8] = pack_float_SL_UNORM8; - table[MESA_FORMAT_L8A8_SRGB] = pack_float_SLA_UNORM8; + table[MESA_FORMAT_BGR_SRGB8] = pack_float_BGR_SRGB8; + table[MESA_FORMAT_A8B8G8R8_SRGB] = pack_float_A8B8G8R8_SRGB; + table[MESA_FORMAT_B8G8R8A8_SRGB] = pack_float_B8G8R8A8_SRGB; + table[MESA_FORMAT_R8G8B8A8_SRGB] = pack_float_R8G8B8A8_SRGB; + table[MESA_FORMAT_L_SRGB8] = pack_float_L_SRGB8; + table[MESA_FORMAT_L8A8_SRGB] = pack_float_L8A8_SRGB; /* n/a */ table[MESA_FORMAT_SRGB_DXT1] = NULL; @@ -2222,7 +2222,7 @@ _mesa_get_pack_float_rgba_function(mesa_format format) table[MESA_FORMAT_B4G4R4X4_UNORM] = pack_float_XRGB4444_UNORM; table[MESA_FORMAT_B5G5R5X1_UNORM] = pack_float_XRGB1555_UNORM; table[MESA_FORMAT_R8G8B8X8_SNORM] = pack_float_XBGR8888_SNORM; - table[MESA_FORMAT_R8G8B8X8_SRGB] = pack_float_XBGR8888_SRGB; + table[MESA_FORMAT_R8G8B8X8_SRGB] = pack_float_R8G8B8X8_SRGB; table[MESA_FORMAT_RGBX_UINT8] = NULL; table[MESA_FORMAT_RGBX_SINT8] = NULL; table[MESA_FORMAT_B10G10R10X2_UNORM] = pack_float_B10G10R10X2_UNORM; @@ -2240,7 +2240,7 @@ _mesa_get_pack_float_rgba_function(mesa_format format) table[MESA_FORMAT_G8R8_SNORM] = pack_float_SIGNED_G8R8_UNORM; table[MESA_FORMAT_G16R16_SNORM] = pack_float_SIGNED_G16R16_UNORM; - table[MESA_FORMAT_B8G8R8X8_SRGB] = pack_float_XRGB8888_SRGB; + table[MESA_FORMAT_B8G8R8X8_SRGB] = pack_float_B8G8R8X8_SRGB; initialized = GL_TRUE; } diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c index ae17ecb5faa..242df7bf326 100644 --- a/src/mesa/main/format_unpack.c +++ b/src/mesa/main/format_unpack.c @@ -758,7 +758,7 @@ unpack_S8(const void *src, GLfloat dst[][4], GLuint n) static void -unpack_SRGB8(const void *src, GLfloat dst[][4], GLuint n) +unpack_BGR_SRGB8(const void *src, GLfloat dst[][4], GLuint n) { const GLubyte *s = (const GLubyte *) src; GLuint i; @@ -771,7 +771,7 @@ unpack_SRGB8(const void *src, GLfloat dst[][4], GLuint n) } static void -unpack_SRGBA_UNORM8(const void *src, GLfloat dst[][4], GLuint n) +unpack_A8B8G8R8_SRGB(const void *src, GLfloat dst[][4], GLuint n) { const GLuint *s = ((const GLuint *) src); GLuint i; @@ -784,7 +784,7 @@ unpack_SRGBA_UNORM8(const void *src, GLfloat dst[][4], GLuint n) } static void -unpack_SARGB8(const void *src, GLfloat dst[][4], GLuint n) +unpack_B8G8R8A8_SRGB(const void *src, GLfloat dst[][4], GLuint n) { const GLuint *s = ((const GLuint *) src); GLuint i; @@ -797,7 +797,7 @@ unpack_SARGB8(const void *src, GLfloat dst[][4], GLuint n) } static void -unpack_SABGR_UNORM8(const void *src, GLfloat dst[][4], GLuint n) +unpack_R8G8B8A8_SRGB(const void *src, GLfloat dst[][4], GLuint n) { const GLuint *s = ((const GLuint *) src); GLuint i; @@ -810,7 +810,7 @@ unpack_SABGR_UNORM8(const void *src, GLfloat dst[][4], GLuint n) } static void -unpack_SL_UNORM8(const void *src, GLfloat dst[][4], GLuint n) +unpack_L_SRGB8(const void *src, GLfloat dst[][4], GLuint n) { const GLubyte *s = ((const GLubyte *) src); GLuint i; @@ -823,7 +823,7 @@ unpack_SL_UNORM8(const void *src, GLfloat dst[][4], GLuint n) } static void -unpack_SLA_UNORM8(const void *src, GLfloat dst[][4], GLuint n) +unpack_L8A8_SRGB(const void *src, GLfloat dst[][4], GLuint n) { const GLushort *s = (const GLushort *) src; GLuint i; @@ -2132,7 +2132,7 @@ unpack_XBGR8888_SNORM(const void *src, GLfloat dst[][4], GLuint n) } static void -unpack_XBGR8888_SRGB(const void *src, GLfloat dst[][4], GLuint n) +unpack_R8G8B8X8_SRGB(const void *src, GLfloat dst[][4], GLuint n) { const GLuint *s = ((const GLuint *) src); GLuint i; @@ -2327,7 +2327,7 @@ unpack_SIGNED_G16R16_UNORM(const void *src, GLfloat dst[][4], GLuint n) } static void -unpack_XRGB8888_SRGB(const void *src, GLfloat dst[][4], GLuint n) +unpack_B8G8R8X8_SRGB(const void *src, GLfloat dst[][4], GLuint n) { const GLuint *s = ((const GLuint *) src); GLuint i; @@ -2398,12 +2398,12 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_X8_UINT_Z24_UNORM] = unpack_Z24_X8; table[MESA_FORMAT_Z_UNORM32] = unpack_Z32; table[MESA_FORMAT_S_UINT8] = unpack_S8; - table[MESA_FORMAT_BGR_SRGB8] = unpack_SRGB8; - table[MESA_FORMAT_A8B8G8R8_SRGB] = unpack_SRGBA_UNORM8; - table[MESA_FORMAT_B8G8R8A8_SRGB] = unpack_SARGB8; - table[MESA_FORMAT_R8G8B8A8_SRGB] = unpack_SABGR_UNORM8; - table[MESA_FORMAT_L_SRGB8] = unpack_SL_UNORM8; - table[MESA_FORMAT_L8A8_SRGB] = unpack_SLA_UNORM8; + table[MESA_FORMAT_BGR_SRGB8] = unpack_BGR_SRGB8; + table[MESA_FORMAT_A8B8G8R8_SRGB] = unpack_A8B8G8R8_SRGB; + table[MESA_FORMAT_B8G8R8A8_SRGB] = unpack_B8G8R8A8_SRGB; + table[MESA_FORMAT_R8G8B8A8_SRGB] = unpack_R8G8B8A8_SRGB; + table[MESA_FORMAT_L_SRGB8] = unpack_L_SRGB8; + table[MESA_FORMAT_L8A8_SRGB] = unpack_L8A8_SRGB; table[MESA_FORMAT_SRGB_DXT1] = unpack_SRGB_DXT1; table[MESA_FORMAT_SRGBA_DXT1] = unpack_SRGBA_DXT1; table[MESA_FORMAT_SRGBA_DXT3] = unpack_SRGBA_DXT3; @@ -2539,7 +2539,7 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_B4G4R4X4_UNORM] = unpack_XRGB4444_UNORM; table[MESA_FORMAT_B5G5R5X1_UNORM] = unpack_XRGB1555_UNORM; table[MESA_FORMAT_R8G8B8X8_SNORM] = unpack_XBGR8888_SNORM; - table[MESA_FORMAT_R8G8B8X8_SRGB] = unpack_XBGR8888_SRGB; + table[MESA_FORMAT_R8G8B8X8_SRGB] = unpack_R8G8B8X8_SRGB; table[MESA_FORMAT_RGBX_UINT8] = unpack_XBGR8888_UINT; table[MESA_FORMAT_RGBX_SINT8] = unpack_XBGR8888_SINT; table[MESA_FORMAT_B10G10R10X2_UNORM] = unpack_B10G10R10X2_UNORM; @@ -2557,7 +2557,7 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_G8R8_SNORM] = unpack_SIGNED_G8R8_UNORM; table[MESA_FORMAT_G16R16_SNORM] = unpack_SIGNED_G16R16_UNORM; - table[MESA_FORMAT_B8G8R8X8_SRGB] = unpack_XRGB8888_SRGB; + table[MESA_FORMAT_B8G8R8X8_SRGB] = unpack_B8G8R8X8_SRGB; initialized = GL_TRUE; } -- 2.30.2