ilo: replace a boolean by bool
[mesa.git] / src / gallium / state_trackers / vega / mask.c
index 17912cb552db31f13e016d2c10d19644c7617114..ca8edd016866002201f6edc7377ad11234420ab1 100644 (file)
@@ -111,8 +111,6 @@ static void read_alpha_mask(void * data, VGint dataStride,
    VGubyte *dst = (VGubyte *)data;
    VGint xoffset = 0, yoffset = 0;
 
-   /* make sure rendering has completed */
-   pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
    if (sx < 0) {
       xoffset = -sx;
       xoffset *= _vega_size_for_format(dataFormat);
@@ -367,7 +365,7 @@ struct vg_mask_layer * mask_layer_create(VGint width, VGint height)
       mask->sampler_view = view;
    }
 
-   vg_context_add_object(ctx, VG_OBJECT_MASK, mask);
+   vg_context_add_object(ctx, &mask->base);
 
    return mask;
 }
@@ -376,8 +374,9 @@ void mask_layer_destroy(struct vg_mask_layer *layer)
 {
    struct vg_context *ctx = vg_current_context();
 
-   vg_context_remove_object(ctx, VG_OBJECT_MASK, layer);
+   vg_context_remove_object(ctx, &layer->base);
    pipe_sampler_view_reference(&layer->sampler_view, NULL);
+   vg_free_object(&layer->base);
    FREE(layer);
 }
 
@@ -386,10 +385,6 @@ void mask_layer_fill(struct vg_mask_layer *layer,
                      VGint width, VGint height,
                      VGfloat value)
 {
-   VGfloat alpha_color[4] = {0, 0, 0, 0};
-
-   alpha_color[3] = value;
-
    mask_resource_fill(layer->sampler_view->texture,
                       x, y, width, height, value);
 }
@@ -404,8 +399,7 @@ void mask_copy(struct vg_mask_layer *layer,
    struct pipe_surface *surf, surf_tmpl;
 
    /* get the destination surface */
-   u_surface_default_template(&surf_tmpl, layer->sampler_view->texture,
-                              PIPE_BIND_RENDER_TARGET);
+   u_surface_default_template(&surf_tmpl, layer->sampler_view->texture);
    surf = ctx->pipe->create_surface(ctx->pipe, layer->sampler_view->texture,
                                     &surf_tmpl);
    if (surf && renderer_copy_begin(ctx->renderer, surf, VG_FALSE, src)) {
@@ -431,18 +425,17 @@ static void mask_layer_render_to(struct vg_mask_layer *layer,
    struct pipe_sampler_view *view = vg_get_surface_mask(ctx);
    struct matrix *mat = &ctx->state.vg.path_user_to_surface_matrix;
    struct pipe_surface *surf, surf_tmpl;
-   u_surface_default_template(&surf_tmpl, view->texture,
-                              PIPE_BIND_RENDER_TARGET);
+   u_surface_default_template(&surf_tmpl, view->texture);
    surf = pipe->create_surface(pipe, view->texture, &surf_tmpl);
 
-   renderer_validate_for_mask_rendering(ctx->renderer, surf);
+   renderer_validate_for_mask_rendering(ctx->renderer, surf, mat);
 
    if (paint_modes & VG_FILL_PATH) {
-      path_fill(path, mat);
+      path_fill(path);
    }
 
    if (paint_modes & VG_STROKE_PATH){
-      path_stroke(path, mat);
+      path_stroke(path);
    }
 
    pipe_surface_reference(&surf, NULL);