intel / DRI2: When available, use DRI2GetBuffersWithFormat
[mesa.git] / src / mesa / state_tracker / st_atom_blend.c
index 6c13fc814158e4d14ad7a1b085130d245df9078c..35c09c3e08fa1b36fbf3012f164908eb1410e7f3 100644 (file)
@@ -39,6 +39,7 @@
 #include "pipe/p_defines.h"
 #include "cso_cache/cso_context.h"
 
+#include "main/macros.h"
 
 /**
  * Convert GLenum blend tokens to pipe tokens.
@@ -213,27 +214,19 @@ update_blend( struct st_context *st )
 
    cso_set_blend(st->cso_context, blend);
 
-   if (memcmp(st->ctx->Color.BlendColor, &st->state.blend_color, 4 * sizeof(GLfloat)) != 0) {
-      /* state has changed */
-      st->state.blend_color.color[0] = st->ctx->Color.BlendColor[0];
-      st->state.blend_color.color[1] = st->ctx->Color.BlendColor[1];
-      st->state.blend_color.color[2] = st->ctx->Color.BlendColor[2];
-      st->state.blend_color.color[3] = st->ctx->Color.BlendColor[3];
-      st->pipe->set_blend_color(st->pipe, (struct pipe_blend_color *) st->ctx->Color.BlendColor);
+   {
+      struct pipe_blend_color bc;
+      COPY_4FV(bc.color, st->ctx->Color.BlendColor);
+      cso_set_blend_color(st->cso_context, &bc);
    }
 }
 
 
 const struct st_tracked_state st_update_blend = {
-   .name = "st_update_blend",
-   .dirty = {
-      .mesa = (_NEW_COLOR),  /* XXX _NEW_BLEND someday? */
-      .st  = 0,
+   "st_update_blend",                                  /* name */
+   {                                                   /* dirty */
+      (_NEW_COLOR),  /* XXX _NEW_BLEND someday? */     /* mesa */
+      0,                                               /* st */
    },
-   .update = update_blend
+   update_blend,                                       /* update */
 };
-
-
-
-
-