Extract cairo_clear_surface.

This commit refactors the i3bar drawing code to also define an abstraction
function for clearing a surface. This is needed to fully abstract i3bar/xcb.c's
drawing code so that we can introduce a switch to easily exchange the
underlying drawing mechanism.
This commit is contained in:
Ingo Bürk
2015-10-14 19:03:05 +02:00
parent 8178910f16
commit 46bcc55f6f
3 changed files with 32 additions and 12 deletions

View File

@ -89,6 +89,13 @@ void cairo_draw_text(i3String *text, surface_t *surface, color_t fg_color, color
*/
void cairo_draw_rectangle(surface_t *surface, color_t color, double x, double y, double w, double h);
/**
* Clears a surface with the given color.
* Note that the drawing is done using CAIRO_OPERATOR_SOURCE.
*
*/
void cairo_clear_surface(surface_t *surface, color_t color);
/**
* Copies a surface onto another surface.
* Note that the drawing is done using CAIRO_OPERATOR_SOURCE.