[Mesa-dev] [PATCH 2/3] mesa: Turn need_rgb_to_luminance_conversion() in to a global function

Tapani Pälli tapani.palli at intel.com
Thu Jun 11 02:46:35 PDT 2015


Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

On 06/11/2015 02:54 AM, Anuj Phogat wrote:
> This will be used by _mesa_meta_pbo_GetTexSubImage() in a later patch.
>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>   src/mesa/main/readpix.c | 11 ++++++-----
>   src/mesa/main/readpix.h |  3 +++
>   2 files changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
> index cba9db8..a3357cd 100644
> --- a/src/mesa/main/readpix.c
> +++ b/src/mesa/main/readpix.c
> @@ -46,8 +46,8 @@
>   /**
>    * Return true if the conversion L=R+G+B is needed.
>    */
> -static GLboolean
> -need_rgb_to_luminance_conversion(mesa_format texFormat, GLenum format)
> +GLboolean
> +_mesa_need_rgb_to_luminance_conversion(mesa_format texFormat, GLenum format)
>   {
>      GLenum baseTexFormat = _mesa_get_format_base_format(texFormat);
>
> @@ -105,7 +105,7 @@ get_readpixels_transfer_ops(const struct gl_context *ctx, mesa_format texFormat,
>       * have any effect anyway.
>       */
>      if (_mesa_get_format_datatype(texFormat) == GL_UNSIGNED_NORMALIZED &&
> -       !need_rgb_to_luminance_conversion(texFormat, format)) {
> +       !_mesa_need_rgb_to_luminance_conversion(texFormat, format)) {
>         transferOps &= ~IMAGE_CLAMP_BIT;
>      }
>
> @@ -149,7 +149,7 @@ _mesa_readpixels_needs_slow_path(const struct gl_context *ctx, GLenum format,
>
>      default:
>         /* Color formats. */
> -      if (need_rgb_to_luminance_conversion(rb->Format, format)) {
> +      if (_mesa_need_rgb_to_luminance_conversion(rb->Format, format)) {
>            return GL_TRUE;
>         }
>
> @@ -442,7 +442,8 @@ read_rgba_pixels( struct gl_context *ctx,
>      dst_is_integer = _mesa_is_enum_format_integer(format);
>      dst_stride = _mesa_image_row_stride(packing, width, format, type);
>      dst_format = _mesa_format_from_format_and_type(format, type);
> -   convert_rgb_to_lum = need_rgb_to_luminance_conversion(rb->Format, format);
> +   convert_rgb_to_lum =
> +      _mesa_need_rgb_to_luminance_conversion(rb->Format, format);
>      dst = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
>                                              format, type, 0, 0);
>
> diff --git a/src/mesa/main/readpix.h b/src/mesa/main/readpix.h
> index 4bb35e1..1636dd9 100644
> --- a/src/mesa/main/readpix.h
> +++ b/src/mesa/main/readpix.h
> @@ -37,6 +37,9 @@ extern GLboolean
>   _mesa_readpixels_needs_slow_path(const struct gl_context *ctx, GLenum format,
>                                    GLenum type, GLboolean uses_blit);
>
> +extern GLboolean
> +_mesa_need_rgb_to_luminance_conversion(mesa_format texFormat, GLenum format);
> +
>   extern void
>   _mesa_readpixels(struct gl_context *ctx,
>                    GLint x, GLint y, GLsizei width, GLsizei height,
>


More information about the mesa-dev mailing list