Call glReadPixels right before swapping buffers

This commit is contained in:
emersion 2017-10-07 12:01:21 +02:00
parent 05096ab458
commit d4cc82f11a
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
6 changed files with 11 additions and 18 deletions

View file

@ -204,7 +204,7 @@ write_png(int width, int height)
}
surface = cairo_image_surface_create_for_data(data,
CAIRO_FORMAT_ARGB32,
CAIRO_FORMAT_RGB24,
width, height, buffer_stride);
cairo_surface_write_to_png(surface, "wayland-screenshot.png");
cairo_surface_destroy(surface);