forked from external/yambar
bar: don't use cairo
This is trivial in the Wayland backend; just instantiate a pixman pointing to the same mmapped memory as the wayland buffer. In the XCB backend, we change the implementation slightly; instead of rendering via a cairo XCB surface backend (to a server side pixmap), which is then blitted to the window in commit(), we now render to a client-side pixman pixmap, and blit it using xcb_put_image() in commit().
This commit is contained in:
parent
c11fee4ce3
commit
01e71590e0
5 changed files with 58 additions and 156 deletions
14
bar/bar.c
14
bar/bar.c
|
@ -61,7 +61,7 @@ static void
|
|||
expose(const struct bar *_bar)
|
||||
{
|
||||
const struct private *bar = _bar->private;
|
||||
pixman_image_t *pix = bar->backend.iface->get_pixman_image(_bar);
|
||||
pixman_image_t *pix = bar->pix;
|
||||
|
||||
pixman_image_fill_rectangles(
|
||||
PIXMAN_OP_SRC, pix, &bar->background, 1,
|
||||
|
@ -138,7 +138,7 @@ expose(const struct bar *_bar)
|
|||
x += bar->left_spacing + e->width + bar->right_spacing;
|
||||
}
|
||||
|
||||
bar->backend.iface->commit_pixman(_bar, pix);
|
||||
bar->backend.iface->commit(_bar);
|
||||
}
|
||||
|
||||
|
||||
|
@ -299,14 +299,6 @@ run(struct bar *_bar)
|
|||
|
||||
bar->backend.iface->cleanup(_bar);
|
||||
|
||||
if (bar->cairo)
|
||||
cairo_destroy(bar->cairo);
|
||||
if (bar->cairo_surface) {
|
||||
cairo_device_finish(cairo_surface_get_device(bar->cairo_surface));
|
||||
cairo_surface_finish(bar->cairo_surface);
|
||||
cairo_surface_destroy(bar->cairo_surface);
|
||||
}
|
||||
|
||||
LOG_DBG("bar exiting");
|
||||
return ret;
|
||||
}
|
||||
|
@ -341,8 +333,6 @@ destroy(struct bar *bar)
|
|||
m->destroy(m);
|
||||
}
|
||||
|
||||
cairo_debug_reset_static_data();
|
||||
|
||||
free(b->left.mods);
|
||||
free(b->left.exps);
|
||||
free(b->center.mods);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue