[mutter/wip/cb2eb3: 32/55] window-actor: Add a debugging tool to write a region to a PNG
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/cb2eb3: 32/55] window-actor: Add a debugging tool to write a region to a PNG
- Date: Wed, 1 Oct 2014 15:50:07 +0000 (UTC)
commit 1e9268045d1f0e2d2bc977a26487c5e4c0aadeba
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun Apr 29 04:44:53 2012 -0400
window-actor: Add a debugging tool to write a region to a PNG
Just a helper function that I keep rewriting all over the place.
src/compositor/meta-window-actor.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 0348336..b9932d4 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -1681,7 +1681,7 @@ meta_window_actor_get_obscured_region (MetaWindowActor *self)
#if 0
/* Print out a region; useful for debugging */
static void
-dump_region (cairo_region_t *region)
+print_region (cairo_region_t *region)
{
int n_rects;
int i;
@@ -1699,6 +1699,26 @@ dump_region (cairo_region_t *region)
}
#endif
+#if 0
+/* Dump a region to a PNG file; useful for debugging */
+static void
+see_region (cairo_region_t *region,
+ int width,
+ int height,
+ char *filename)
+{
+ cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_A8, width, height);
+ cairo_t *cr = cairo_create (surface);
+
+ gdk_cairo_region (cr, region);
+ cairo_fill (cr);
+
+ cairo_surface_write_to_png (surface, filename);
+ cairo_destroy (cr);
+ cairo_surface_destroy (surface);
+}
+#endif
+
/**
* meta_window_actor_set_visible_region:
* @self: a #MetaWindowActor
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]