mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
clutter: Remove old split capture based screen shooting API
This is no longer used, and the replacement (clutter_stage_paint_to_*()) should be used instead. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
This commit is contained in:
parent
1743887fa7
commit
a80b0f34e3
@ -3641,102 +3641,6 @@ clutter_stage_presented (ClutterStage *stage,
|
|||||||
g_signal_emit (stage, stage_signals[PRESENTED], 0, view, frame_info);
|
g_signal_emit (stage, stage_signals[PRESENTED], 0, view, frame_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
capture_view (ClutterStage *stage,
|
|
||||||
gboolean paint,
|
|
||||||
ClutterStageView *view,
|
|
||||||
ClutterCapture *capture)
|
|
||||||
{
|
|
||||||
cairo_surface_t *image;
|
|
||||||
uint8_t *data;
|
|
||||||
int stride;
|
|
||||||
cairo_rectangle_int_t *rect;
|
|
||||||
float view_scale;
|
|
||||||
float texture_width;
|
|
||||||
float texture_height;
|
|
||||||
|
|
||||||
rect = &capture->rect;
|
|
||||||
|
|
||||||
view_scale = clutter_stage_view_get_scale (view);
|
|
||||||
texture_width = roundf (rect->width * view_scale);
|
|
||||||
texture_height = roundf (rect->height * view_scale);
|
|
||||||
image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
|
||||||
texture_width, texture_height);
|
|
||||||
cairo_surface_set_device_scale (image, view_scale, view_scale);
|
|
||||||
|
|
||||||
data = cairo_image_surface_get_data (image);
|
|
||||||
stride = cairo_image_surface_get_stride (image);
|
|
||||||
|
|
||||||
capture_view_into (stage, paint, view, rect, data, stride);
|
|
||||||
capture->image = image;
|
|
||||||
|
|
||||||
cairo_surface_mark_dirty (capture->image);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_stage_capture:
|
|
||||||
* @stage: a #ClutterStage
|
|
||||||
* @paint: whether to pain the frame
|
|
||||||
* @rect: a #cairo_rectangle_int_t in stage coordinates
|
|
||||||
* @out_captures: (out) (array length=out_n_captures): an array of
|
|
||||||
* #ClutterCapture
|
|
||||||
* @out_n_captures: (out): the number of captures in @out_captures
|
|
||||||
*
|
|
||||||
* Captures the stage pixels of @rect into @captures. @rect is in stage
|
|
||||||
* coordinates.
|
|
||||||
*
|
|
||||||
* Returns: %TRUE if a #ClutterCapture has been created, %FALSE otherwise
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_stage_capture (ClutterStage *stage,
|
|
||||||
gboolean paint,
|
|
||||||
cairo_rectangle_int_t *rect,
|
|
||||||
ClutterCapture **out_captures,
|
|
||||||
int *out_n_captures)
|
|
||||||
{
|
|
||||||
ClutterStagePrivate *priv = stage->priv;
|
|
||||||
GList *views = _clutter_stage_window_get_views (priv->impl);
|
|
||||||
GList *l;
|
|
||||||
ClutterCapture *captures;
|
|
||||||
int n_captures;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
|
|
||||||
|
|
||||||
captures = g_new0 (ClutterCapture, g_list_length (views));
|
|
||||||
n_captures = 0;
|
|
||||||
|
|
||||||
for (l = views; l; l = l->next)
|
|
||||||
{
|
|
||||||
ClutterStageView *view = l->data;
|
|
||||||
ClutterCapture *capture;
|
|
||||||
cairo_rectangle_int_t view_layout;
|
|
||||||
cairo_region_t *region;
|
|
||||||
|
|
||||||
clutter_stage_view_get_layout (view, &view_layout);
|
|
||||||
region = cairo_region_create_rectangle (&view_layout);
|
|
||||||
cairo_region_intersect_rectangle (region, rect);
|
|
||||||
|
|
||||||
capture = &captures[n_captures];
|
|
||||||
cairo_region_get_extents (region, &capture->rect);
|
|
||||||
cairo_region_destroy (region);
|
|
||||||
|
|
||||||
if (capture->rect.width == 0 || capture->rect.height == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
capture_view (stage, paint, view, capture);
|
|
||||||
|
|
||||||
n_captures++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (n_captures == 0)
|
|
||||||
g_clear_pointer (&captures, g_free);
|
|
||||||
|
|
||||||
*out_captures = captures;
|
|
||||||
*out_n_captures = n_captures;
|
|
||||||
|
|
||||||
return n_captures > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
clutter_stage_get_capture_final_size (ClutterStage *stage,
|
clutter_stage_get_capture_final_size (ClutterStage *stage,
|
||||||
cairo_rectangle_int_t *rect,
|
cairo_rectangle_int_t *rect,
|
||||||
|
@ -218,13 +218,6 @@ gboolean clutter_stage_get_capture_final_size (ClutterStage *stage,
|
|||||||
int *height,
|
int *height,
|
||||||
float *scale);
|
float *scale);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean clutter_stage_capture (ClutterStage *stage,
|
|
||||||
gboolean paint,
|
|
||||||
cairo_rectangle_int_t *rect,
|
|
||||||
ClutterCapture **out_captures,
|
|
||||||
int *out_n_captures);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_stage_paint_to_framebuffer (ClutterStage *stage,
|
void clutter_stage_paint_to_framebuffer (ClutterStage *stage,
|
||||||
CoglFramebuffer *framebuffer,
|
CoglFramebuffer *framebuffer,
|
||||||
|
Loading…
Reference in New Issue
Block a user