Loading

Paste #pvelbi0ey

  1. diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
  2. index 6b231f067e..025282af25 100644
  3. --- a/gdk/gdkwindow.c
  4. +++ b/gdk/gdkwindow.c
  5. @@ -3020,6 +3020,25 @@ gdk_window_end_paint_internal (GdkWindow *window)
  6.    if (impl_class->end_paint)
  7.      impl_class->end_paint (window);
  8.  
  9. +  {
  10. +    static int counter = 0;
  11. +    char *name = g_strdup_printf ("paint%05d.png", ++counter);
  12. +    cairo_surface_t *surface;
  13. +    cairo_rectangle_int_t extents;
  14. +
  15. +    cairo_region_get_extents (window->current_paint.region, &extents);
  16. +    surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, extents.width, extents.height);
  17. +    cairo_surface_set_device_offset (surface, -extents.x, -extents.y);
  18. +    cr = cairo_create (surface);
  19. +    cairo_set_source_surface (cr, window->current_paint.surface, 0, 0);
  20. +    gdk_cairo_region (cr, window->current_paint.region);
  21. +    cairo_fill (cr);
  22. +    cairo_destroy (cr);
  23. +    cairo_surface_write_to_png (surface, name);
  24. +    g_free (name);
  25. +    cairo_surface_destroy (surface);
  26. +  }
  27. +  
  28.    if (window->current_paint.surface_needs_composite)
  29.      {
  30.        cairo_surface_t *surface;