Merge branch '7.8' into master
[mesa.git] / src / gallium / state_trackers / vega / api_masks.c
index 4f9f3dae173d1ba92c75a7c76d02f31fda81c8d2..2f2d925252d5a26b8c9124b803dac59c3a44795a 100644 (file)
@@ -31,8 +31,7 @@
 
 #include "vg_context.h"
 #include "pipe/p_context.h"
-#include "pipe/p_inlines.h"
-#include "pipe/internal/p_winsys_screen.h" /* for winsys->update_buffer */
+#include "util/u_inlines.h"
 
 #include "util/u_pack_color.h"
 #include "util/u_draw_quad.h"
@@ -87,6 +86,8 @@ draw_clear_quad(struct vg_context *st,
 
    /* draw */
    if (buf) {
+      cso_set_vertex_elements(st->cso_context, 2, st->velems);
+
       util_draw_vertex_buffer(pipe, buf, 0,
                               PIPE_PRIM_TRIANGLE_FAN,
                               4,  /* verts */
@@ -116,10 +117,6 @@ clear_with_quad(struct vg_context *st, float x0, float y0,
      x1, y1);
    */
 
-   if (st->pipe->winsys && st->pipe->winsys->update_buffer)
-      st->pipe->winsys->update_buffer( st->pipe->winsys,
-                                       st->pipe->priv );
-
    cso_save_blend(st->cso_context);
    cso_save_rasterizer(st->cso_context);
    cso_save_fragment_shader(st->cso_context);
@@ -129,14 +126,11 @@ clear_with_quad(struct vg_context *st, float x0, float y0,
    {
       struct pipe_blend_state blend;
       memset(&blend, 0, sizeof(blend));
-      blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE;
-      blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE;
-      blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
-      blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
-      blend.colormask |= PIPE_MASK_R;
-      blend.colormask |= PIPE_MASK_G;
-      blend.colormask |= PIPE_MASK_B;
-      blend.colormask |= PIPE_MASK_A;
+      blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+      blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+      blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+      blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+      blend.rt[0].colormask = PIPE_MASK_RGBA;
       cso_set_blend(st->cso_context, &blend);
    }