window: Remove display_flush_cairo_device
Rather add a flush_surface utility that
flushed the cairo_device thats associated to a surface.
diff --git a/clients/cairo-util.c b/clients/cairo-util.c
index 7bcfe41..184f58e 100644
--- a/clients/cairo-util.c
+++ b/clients/cairo-util.c
@@ -31,6 +31,16 @@
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
void
+surface_flush_device(cairo_surface_t *surface)
+{
+ cairo_device_t *device;
+
+ device = cairo_surface_get_device(surface);
+ if (device)
+ cairo_device_flush(device);
+}
+
+void
blur_surface(cairo_surface_t *surface, int margin)
{
int32_t width, height, stride, x, y, z, w;
diff --git a/clients/cairo-util.h b/clients/cairo-util.h
index 257489a..e490b9f 100644
--- a/clients/cairo-util.h
+++ b/clients/cairo-util.h
@@ -24,6 +24,9 @@
#define _CAIRO_UTIL_H
void
+surface_flush_device(cairo_surface_t *surface);
+
+void
blur_surface(cairo_surface_t *surface, int margin);
void
diff --git a/clients/dnd.c b/clients/dnd.c
index 707ef5d..5bfe31c 100644
--- a/clients/dnd.c
+++ b/clients/dnd.c
@@ -35,6 +35,7 @@
#include "wayland-client.h"
#include "window.h"
+#include "cairo-util.h"
struct dnd {
struct window *window;
@@ -544,7 +545,7 @@
cairo_surface_destroy(pointer);
cairo_paint(cr);
/* FIXME: more cairo-gl brokeness */
- display_flush_cairo_device(dnd->display);
+ surface_flush_device(surface);
cairo_destroy(cr);
dnd_drag->hotspot_x = pointer_width + x - item->x;
diff --git a/clients/window.c b/clients/window.c
index 54adde6..e9e8a27 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -1037,12 +1037,6 @@
}
void
-display_flush_cairo_device(struct display *display)
-{
- cairo_device_flush (display->device);
-}
-
-void
window_draw(struct window *window)
{
if (window->parent)
diff --git a/clients/window.h b/clients/window.h
index 2409197..60da5ca 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -101,9 +101,6 @@
void *data);
void
-display_flush_cairo_device(struct display *display);
-
-void
display_defer(struct display *display, struct task *task);
void