[mutter/gbsneto/explicit-framebuffer-preparations: 8/14] clutter-stage: Pass framebuffer to read pixels from
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/explicit-framebuffer-preparations: 8/14] clutter-stage: Pass framebuffer to read pixels from
- Date: Sat, 10 Nov 2018 01:30:50 +0000 (UTC)
commit e9cbd0a48c083a460c2bbe37ba96fd8921b7081d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Nov 8 19:35:55 2018 -0200
clutter-stage: Pass framebuffer to read pixels from
Instead of using cogl_read_pixels(), which is deprecated and
uses the implicit framebuffer, pass the current CoglFramebuffer
and use cogl_framebuffer_read_pixels().
clutter/clutter/clutter-stage.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index 5ee02dbfb..828071a48 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -1391,11 +1391,12 @@ clutter_stage_get_redraw_clip_bounds (ClutterStage *stage,
}
static void
-read_pixels_to_file (char *filename_stem,
- int x,
- int y,
- int width,
- int height)
+read_pixels_to_file (CoglFramebuffer *fb,
+ char *filename_stem,
+ int x,
+ int y,
+ int width,
+ int height)
{
guint8 *data;
cairo_surface_t *surface;
@@ -1405,10 +1406,10 @@ read_pixels_to_file (char *filename_stem,
read_count);
data = g_malloc (4 * width * height);
- cogl_read_pixels (x, y, width, height,
- COGL_READ_PIXELS_COLOR_BUFFER,
- CLUTTER_CAIRO_FORMAT_ARGB32,
- data);
+ cogl_framebuffer_read_pixels (fb,
+ x, y, width, height,
+ CLUTTER_CAIRO_FORMAT_ARGB32,
+ data);
surface = cairo_image_surface_create_for_data (data, CAIRO_FORMAT_RGB24,
width, height,
@@ -1532,7 +1533,7 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
_clutter_actor_get_debug_name (actor),
view_layout.x);
- read_pixels_to_file (file_name, 0, 0, fb_width, fb_height);
+ read_pixels_to_file (fb, file_name, 0, 0, fb_width, fb_height);
g_free (file_name);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]