vulkan: Clear Cairo surfaces on upload

The memory isn't guaranteed to be all zeroes and we don't want glitches.
This commit is contained in:
Benjamin Otte 2023-07-23 18:26:52 +02:00
parent e98ae233fc
commit e00e6f3d5d

View File

@ -287,6 +287,9 @@ gsk_vulkan_upload_cairo_op_draw (GskVulkanOp *op,
width / self->viewport.size.width,
height / self->viewport.size.height);
cr = cairo_create (surface);
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
cairo_paint (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
cairo_translate (cr, -self->viewport.origin.x, -self->viewport.origin.y);
gsk_render_node_draw (self->node, cr);
@ -402,6 +405,9 @@ gsk_vulkan_upload_glyph_op_draw (GskVulkanOp *op,
cairo_surface_set_device_scale (surface, self->scale, self->scale);
cr = cairo_create (surface);
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
cairo_paint (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
/* Make sure the entire surface is initialized to black */
cairo_set_source_rgba (cr, 0, 0, 0, 0);