clutter: Expose clutter_stage_paint_to_(frame)buffer()

This will be used by GNOME Shell to take screenshots.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
This commit is contained in:
Jonas Ådahl 2020-07-29 11:46:51 +02:00
parent b4a8247191
commit 1743887fa7
2 changed files with 18 additions and 17 deletions

View File

@ -55,23 +55,6 @@ void clutter_stage_capture_into (ClutterStage *stage,
cairo_rectangle_int_t *rect, cairo_rectangle_int_t *rect,
uint8_t *data); uint8_t *data);
CLUTTER_EXPORT
void clutter_stage_paint_to_framebuffer (ClutterStage *stage,
CoglFramebuffer *framebuffer,
const cairo_rectangle_int_t *rect,
float scale,
ClutterPaintFlag paint_flags);
CLUTTER_EXPORT
gboolean clutter_stage_paint_to_buffer (ClutterStage *stage,
const cairo_rectangle_int_t *rect,
float scale,
uint8_t *data,
int stride,
CoglPixelFormat format,
ClutterPaintFlag paint_flags,
GError **error);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_stage_clear_stage_views (ClutterStage *stage); void clutter_stage_clear_stage_views (ClutterStage *stage);

View File

@ -224,6 +224,24 @@ gboolean clutter_stage_capture (ClutterStage *stage,
cairo_rectangle_int_t *rect, cairo_rectangle_int_t *rect,
ClutterCapture **out_captures, ClutterCapture **out_captures,
int *out_n_captures); int *out_n_captures);
CLUTTER_EXPORT
void clutter_stage_paint_to_framebuffer (ClutterStage *stage,
CoglFramebuffer *framebuffer,
const cairo_rectangle_int_t *rect,
float scale,
ClutterPaintFlag paint_flags);
CLUTTER_EXPORT
gboolean clutter_stage_paint_to_buffer (ClutterStage *stage,
const cairo_rectangle_int_t *rect,
float scale,
uint8_t *data,
int stride,
CoglPixelFormat format,
ClutterPaintFlag paint_flags,
GError **error);
CLUTTER_EXPORT CLUTTER_EXPORT
ClutterStageView * clutter_stage_get_view_at (ClutterStage *stage, ClutterStageView * clutter_stage_get_view_at (ClutterStage *stage,
float x, float x,