[Mesa-dev] [PATCH 18/38] main: Refactor _mesa_[update|get]_clamp_vertex_color.

Fredrik Höglund fredrik at kde.org
Sun Apr 12 08:56:50 PDT 2015


Reviewed-by: Fredrik Höglund <fredrik at kde.org>

On Wednesday 04 March 2015, Laura Ekstrand wrote:
> ---
>  src/mesa/main/blend.c       | 13 ++++++++-----
>  src/mesa/main/blend.h       |  7 +++++--
>  src/mesa/main/framebuffer.c |  2 +-
>  3 files changed, 14 insertions(+), 8 deletions(-)
> 
> diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
> index 774fc88..ee76b47 100644
> --- a/src/mesa/main/blend.c
> +++ b/src/mesa/main/blend.c
> @@ -769,7 +769,7 @@ _mesa_ClampColor(GLenum target, GLenum clamp)
>        }
>        FLUSH_VERTICES(ctx, _NEW_LIGHT);
>        ctx->Light.ClampVertexColor = clamp;
> -      _mesa_update_clamp_vertex_color(ctx);
> +      _mesa_update_clamp_vertex_color(ctx, ctx->DrawBuffer);
>        break;
>     case GL_CLAMP_FRAGMENT_COLOR_ARB:
>        if (ctx->API == API_OPENGL_CORE &&
> @@ -814,9 +814,10 @@ _mesa_get_clamp_fragment_color(const struct gl_context *ctx)
>  }
>  
>  GLboolean
> -_mesa_get_clamp_vertex_color(const struct gl_context *ctx)
> +_mesa_get_clamp_vertex_color(const struct gl_context *ctx,
> +                             const struct gl_framebuffer *drawFb)
>  {
> -   return get_clamp_color(ctx->DrawBuffer, ctx->Light.ClampVertexColor);
> +   return get_clamp_color(drawFb, ctx->Light.ClampVertexColor);
>  }
>  
>  GLboolean
> @@ -848,9 +849,11 @@ _mesa_update_clamp_fragment_color(struct gl_context *ctx)
>   * Update the ctx->Color._ClampVertexColor field
>   */
>  void
> -_mesa_update_clamp_vertex_color(struct gl_context *ctx)
> +_mesa_update_clamp_vertex_color(struct gl_context *ctx,
> +                                const struct gl_framebuffer *drawFb)
>  {
> -   ctx->Light._ClampVertexColor = _mesa_get_clamp_vertex_color(ctx);
> +   ctx->Light._ClampVertexColor =
> +         _mesa_get_clamp_vertex_color(ctx, drawFb);
>  }
>  
>  /**
> diff --git a/src/mesa/main/blend.h b/src/mesa/main/blend.h
> index fe31a74..9c1ef7e 100644
> --- a/src/mesa/main/blend.h
> +++ b/src/mesa/main/blend.h
> @@ -37,6 +37,7 @@
>  #include "formats.h"
>  
>  struct gl_context;
> +struct gl_framebuffer;
>  
>  
>  extern void GLAPIENTRY
> @@ -104,7 +105,8 @@ extern GLboolean
>  _mesa_get_clamp_fragment_color(const struct gl_context *ctx);
>  
>  extern GLboolean
> -_mesa_get_clamp_vertex_color(const struct gl_context *ctx);
> +_mesa_get_clamp_vertex_color(const struct gl_context *ctx,
> +                             const struct gl_framebuffer *drawFb);
>  
>  extern GLboolean
>  _mesa_get_clamp_read_color(const struct gl_context *ctx);
> @@ -113,7 +115,8 @@ extern void
>  _mesa_update_clamp_fragment_color(struct gl_context *ctx);
>  
>  extern void
> -_mesa_update_clamp_vertex_color(struct gl_context *ctx);
> +_mesa_update_clamp_vertex_color(struct gl_context *ctx,
> +                                const struct gl_framebuffer *drawFb);
>  
>  extern mesa_format
>  _mesa_get_render_format(const struct gl_context *ctx, mesa_format format);
> diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
> index 31d05f8..22db72a 100644
> --- a/src/mesa/main/framebuffer.c
> +++ b/src/mesa/main/framebuffer.c
> @@ -691,7 +691,7 @@ _mesa_update_framebuffer(struct gl_context *ctx,
>     if (readFb != drawFb)
>        update_framebuffer(ctx, readFb);
>  
> -   _mesa_update_clamp_vertex_color(ctx);
> +   _mesa_update_clamp_vertex_color(ctx, drawFb);
>     _mesa_update_clamp_fragment_color(ctx);
>  }
>  
> 



More information about the mesa-dev mailing list