mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
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. https://bugzilla.gnome.org/show_bug.cgi?id=676052
This commit is contained in:
parent
ac18f41ed1
commit
30bc8bc6ce
@ -1684,7 +1684,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;
|
||||
@ -1702,6 +1702,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
|
||||
|
Loading…
Reference in New Issue
Block a user