summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-05-24 09:55:27 +0300
committerAlon Levy <alevy@redhat.com>2012-06-27 14:41:30 +0300
commit3ae4cb47665060102b83e1954a768ed44f2b9d2c (patch)
tree2863f81a0512360696ada410a755e54fd197a2d8
parent7abfa40c9ff4dd3092b040d05148f824ee436396 (diff)
qxl_surface: normalize surface_send names, add option to surface_destroy to send/not send destroy message
-rw-r--r--src/qxl_surface.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/qxl_surface.c b/src/qxl_surface.c
index 347503d..da0d03c 100644
--- a/src/qxl_surface.c
+++ b/src/qxl_surface.c
@@ -752,18 +752,28 @@ unlink_surface (qxl_surface_t *surface)
}
static void
-send_destroy (qxl_surface_t *surface)
+surface_send_destroy(qxl_surface_t *surface)
{
struct QXLSurfaceCmd *cmd;
+#if 0
+ ErrorF("destroy %ld\n", (long int)surface->end - (long int)surface->address);
+#endif
+ cmd = make_surface_cmd (surface->cache, surface->id, QXL_SURFACE_CMD_DESTROY);
+
+ push_surface_cmd (surface->cache, cmd);
+}
+
+static void
+surface_destroy (qxl_surface_t *surface, int send_cmd)
+{
if (surface->dev_image)
pixman_image_unref (surface->dev_image);
if (surface->host_image)
pixman_image_unref (surface->host_image);
-
- cmd = make_surface_cmd (surface->cache, surface->id, QXL_SURFACE_CMD_DESTROY);
-
- push_surface_cmd (surface->cache, cmd);
+ if (send_cmd) {
+ surface_send_destroy (surface);
+ }
}
static void
@@ -844,7 +854,7 @@ qxl_surface_unref (surface_cache_t *cache, uint32_t id)
qxl_surface_t *surface = cache->all_surfaces + id;
if (--surface->ref_count == 0)
- send_destroy (surface);
+ surface_destroy (surface, 1);
}
}
@@ -1096,7 +1106,7 @@ qxl_surface_cache_evacuate_all (surface_cache_t *cache)
{
if (cache->cached_surfaces[i])
{
- send_destroy (cache->cached_surfaces[i]);
+ surface_destroy (cache->cached_surfaces[i], 1);
cache->cached_surfaces[i] = NULL;
}
}