diff options
author | Marek Olšák <[email protected]> | 2013-01-25 21:21:22 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2013-02-06 14:51:32 +0100 |
commit | bc2ceb97f1b0f3536b75165c26d9fbd190494fb3 (patch) | |
tree | db9d62e5a37a3deeed7fed0fcd654c13c37087db /src/gallium/auxiliary/util | |
parent | b92057a9837dfd87687d045609d1658089188998 (diff) |
gallium/util: remove duplicated function util_format_is_rgb_no_alpha
It only checks if alpha is present, so it's the same as util_format_has_alpha.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_format.c | 11 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_format.h | 26 |
2 files changed, 5 insertions, 32 deletions
diff --git a/src/gallium/auxiliary/util/u_format.c b/src/gallium/auxiliary/util/u_format.c index 8228de1f23d..18456371c0a 100644 --- a/src/gallium/auxiliary/util/u_format.c +++ b/src/gallium/auxiliary/util/u_format.c @@ -63,17 +63,14 @@ util_format_is_float(enum pipe_format format) /** Test if the format contains RGB, but not alpha */ boolean -util_format_is_rgb_no_alpha(enum pipe_format format) +util_format_has_alpha(enum pipe_format format) { const struct util_format_description *desc = util_format_description(format); - if ((desc->colorspace == UTIL_FORMAT_COLORSPACE_RGB || - desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB) && - desc->swizzle[3] == UTIL_FORMAT_SWIZZLE_1) { - return TRUE; - } - return FALSE; + return (desc->colorspace == UTIL_FORMAT_COLORSPACE_RGB || + desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB) && + desc->swizzle[3] != UTIL_FORMAT_SWIZZLE_1; } diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 024dabb07ba..156d5cf978a 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -567,7 +567,7 @@ util_format_is_float(enum pipe_format format); boolean -util_format_is_rgb_no_alpha(enum pipe_format format); +util_format_has_alpha(enum pipe_format format); boolean @@ -772,30 +772,6 @@ util_format_get_component_bits(enum pipe_format format, } } -static INLINE boolean -util_format_has_alpha(enum pipe_format format) -{ - const struct util_format_description *desc = util_format_description(format); - - assert(format); - if (!format) { - return FALSE; - } - - switch (desc->colorspace) { - case UTIL_FORMAT_COLORSPACE_RGB: - case UTIL_FORMAT_COLORSPACE_SRGB: - return desc->swizzle[3] != UTIL_FORMAT_SWIZZLE_1; - case UTIL_FORMAT_COLORSPACE_YUV: - return FALSE; - case UTIL_FORMAT_COLORSPACE_ZS: - return FALSE; - default: - assert(0); - return FALSE; - } -} - /** * Given a linear RGB colorspace format, return the corresponding SRGB * format, or PIPE_FORMAT_NONE if none. |