clutter: Replace cairo_rectangle_int_t with MtkRectangle

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
This commit is contained in:
Bilal Elmoussaoui 2023-07-19 16:31:26 +02:00
parent 7ee5b0c3e6
commit 06b5cb0761
18 changed files with 187 additions and 180 deletions

View File

@ -7707,7 +7707,7 @@ _clutter_actor_queue_only_relayout (ClutterActor *self)
*/
void
clutter_actor_queue_redraw_with_clip (ClutterActor *self,
const cairo_rectangle_int_t *clip)
const MtkRectangle *clip)
{
ClutterPaintVolume volume;
graphene_point3d_t origin;

View File

@ -40,6 +40,7 @@
#include "clutter/clutter-event.h"
#include "clutter/clutter-paint-context.h"
#include "clutter/clutter-pick-context.h"
#include "mtk/mtk.h"
G_BEGIN_DECLS
@ -336,7 +337,7 @@ CLUTTER_EXPORT
void clutter_actor_queue_redraw (ClutterActor *self);
CLUTTER_EXPORT
void clutter_actor_queue_redraw_with_clip (ClutterActor *self,
const cairo_rectangle_int_t *clip);
const MtkRectangle *clip);
CLUTTER_EXPORT
void clutter_actor_queue_relayout (ClutterActor *self);
CLUTTER_EXPORT

View File

@ -359,7 +359,7 @@ gboolean
clutter_image_set_area (ClutterImage *image,
const guint8 *data,
CoglPixelFormat pixel_format,
const cairo_rectangle_int_t *area,
const MtkRectangle *area,
guint row_stride,
GError **error)
{

View File

@ -30,6 +30,7 @@
#include "cogl/cogl.h"
#include "clutter/clutter-types.h"
#include "mtk/mtk.h"
G_BEGIN_DECLS
@ -64,7 +65,7 @@ CLUTTER_EXPORT
gboolean clutter_image_set_area (ClutterImage *image,
const guint8 *data,
CoglPixelFormat pixel_format,
const cairo_rectangle_int_t *rect,
const MtkRectangle *rect,
guint row_stride,
GError **error);
CLUTTER_EXPORT

View File

@ -37,6 +37,7 @@
#include "clutter/clutter-stage-view.h"
#include "clutter/clutter-stage-view-private.h"
#include "clutter/clutter.h"
#include "mtk/mtk.h"
/* An epsilon larger than FLT_EPSILON that is useful when comparing coordinates
* while ignoring floating point precision loss that might happen during
@ -82,7 +83,7 @@ int64_t clutter_stage_get_frame_counter (ClutterStage *stage);
CLUTTER_EXPORT
void clutter_stage_capture_view_into (ClutterStage *stage,
ClutterStageView *view,
cairo_rectangle_int_t *rect,
MtkRectangle *rect,
uint8_t *data,
int stride);

View File

@ -431,7 +431,7 @@ clutter_pick_stack_pop_transform (ClutterPickStack *pick_stack)
static gboolean
get_verts_rectangle (graphene_point3d_t verts[4],
cairo_rectangle_int_t *rect)
MtkRectangle *rect)
{
if (verts[0].x != verts[2].x ||
verts[0].y != verts[1].y ||
@ -441,7 +441,7 @@ get_verts_rectangle (graphene_point3d_t verts[4],
verts[0].y > verts[3].y)
return FALSE;
*rect = (cairo_rectangle_int_t) {
*rect = (MtkRectangle) {
.x = ceilf (verts[0].x),
.y = ceilf (verts[0].y),
.width = floor (verts[1].x - ceilf (verts[0].x)),
@ -459,7 +459,7 @@ calculate_clear_area (ClutterPickStack *pick_stack,
{
cairo_region_t *area = NULL;
graphene_point3d_t verts[4];
cairo_rectangle_int_t rect;
MtkRectangle rect;
int i;
clutter_actor_get_abs_allocation_vertices (pick_rec->actor,
@ -495,7 +495,7 @@ calculate_clear_area (ClutterPickStack *pick_stack,
continue;
cairo_region_subtract_rectangle (area,
&(cairo_rectangle_int_t) {
&(MtkRectangle) {
.x = paint_box.x1,
.y = paint_box.y1,
.width = paint_box.x2 - paint_box.x1,

View File

@ -37,6 +37,7 @@
#include "clutter/clutter-settings.h"
#include "clutter/clutter-stage-manager.h"
#include "clutter/clutter-stage.h"
#include "mtk/mtk.h"
G_BEGIN_DECLS
@ -201,28 +202,28 @@ void _clutter_util_fully_transform_vertices (const graphene_matrix_t *modelvie
int n_vertices);
CLUTTER_EXPORT
void _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
void _clutter_util_rect_from_rectangle (const MtkRectangle *src,
graphene_rect_t *dest);
CLUTTER_EXPORT
void _clutter_util_rectangle_int_extents (const graphene_rect_t *src,
cairo_rectangle_int_t *dest);
MtkRectangle *dest);
void _clutter_util_rectangle_offset (const cairo_rectangle_int_t *src,
void _clutter_util_rectangle_offset (const MtkRectangle *src,
int x,
int y,
cairo_rectangle_int_t *dest);
MtkRectangle *dest);
void _clutter_util_rectangle_union (const cairo_rectangle_int_t *src1,
const cairo_rectangle_int_t *src2,
cairo_rectangle_int_t *dest);
void _clutter_util_rectangle_union (const MtkRectangle *src1,
const MtkRectangle *src2,
MtkRectangle *dest);
gboolean _clutter_util_rectangle_intersection (const cairo_rectangle_int_t *src1,
const cairo_rectangle_int_t *src2,
cairo_rectangle_int_t *dest);
gboolean _clutter_util_rectangle_intersection (const MtkRectangle *src1,
const MtkRectangle *src2,
MtkRectangle *dest);
gboolean clutter_util_rectangle_equal (const cairo_rectangle_int_t *src1,
const cairo_rectangle_int_t *src2);
gboolean clutter_util_rectangle_equal (const MtkRectangle *src1,
const MtkRectangle *src2);
CLUTTER_EXPORT
PangoDirection _clutter_pango_unichar_direction (gunichar ch);

View File

@ -19,6 +19,7 @@
#include "clutter/clutter-stage-view.h"
#include "clutter/clutter-types.h"
#include "mtk/mtk.h"
CLUTTER_EXPORT
void clutter_stage_view_after_paint (ClutterStageView *view,
@ -47,7 +48,7 @@ void clutter_stage_view_set_projection (ClutterStageView *view,
CLUTTER_EXPORT
void clutter_stage_view_add_redraw_clip (ClutterStageView *view,
const cairo_rectangle_int_t *clip);
const MtkRectangle *clip);
gboolean clutter_stage_view_has_full_redraw_clip (ClutterStageView *view);
@ -69,10 +70,10 @@ CoglScanout * clutter_stage_view_take_scanout (ClutterStageView *view);
CLUTTER_EXPORT
void clutter_stage_view_transform_rect_to_onscreen (ClutterStageView *view,
const cairo_rectangle_int_t *src_rect,
const MtkRectangle *src_rect,
int dst_width,
int dst_height,
cairo_rectangle_int_t *dst_rect);
MtkRectangle *dst_rect);
CLUTTER_EXPORT
void clutter_stage_view_schedule_update (ClutterStageView *view);

View File

@ -20,7 +20,6 @@
#include "clutter/clutter-stage-view.h"
#include "clutter/clutter-stage-view-private.h"
#include <cairo-gobject.h>
#include <math.h>
#include "clutter/clutter-damage-history.h"
@ -64,7 +63,7 @@ typedef struct _ClutterStageViewPrivate
ClutterStage *stage;
cairo_rectangle_int_t layout;
MtkRectangle layout;
float scale;
CoglFramebuffer *framebuffer;
@ -117,7 +116,7 @@ clutter_stage_view_destroy (ClutterStageView *view)
void
clutter_stage_view_get_layout (ClutterStageView *view,
cairo_rectangle_int_t *rect)
MtkRectangle *rect)
{
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
@ -214,10 +213,10 @@ clutter_stage_view_invalidate_offscreen_blit_pipeline (ClutterStageView *view)
void
clutter_stage_view_transform_rect_to_onscreen (ClutterStageView *view,
const cairo_rectangle_int_t *src_rect,
const MtkRectangle *src_rect,
int dst_width,
int dst_height,
cairo_rectangle_int_t *dst_rect)
MtkRectangle *dst_rect)
{
ClutterStageViewClass *view_class = CLUTTER_STAGE_VIEW_GET_CLASS (view);
@ -238,8 +237,8 @@ paint_transformed_framebuffer (ClutterStageView *view,
graphene_matrix_t matrix;
unsigned int n_rectangles, i;
int dst_width, dst_height;
cairo_rectangle_int_t view_layout;
cairo_rectangle_int_t onscreen_layout;
MtkRectangle view_layout;
MtkRectangle onscreen_layout;
float view_scale;
float *coordinates;
@ -247,7 +246,7 @@ paint_transformed_framebuffer (ClutterStageView *view,
dst_height = cogl_framebuffer_get_height (dst_framebuffer);
clutter_stage_view_get_layout (view, &view_layout);
clutter_stage_view_transform_rect_to_onscreen (view,
&(cairo_rectangle_int_t) {
&(MtkRectangle) {
.width = view_layout.width,
.height = view_layout.height,
},
@ -275,8 +274,8 @@ paint_transformed_framebuffer (ClutterStageView *view,
for (i = 0; i < n_rectangles; i++)
{
cairo_rectangle_int_t src_rect;
cairo_rectangle_int_t dst_rect;
MtkRectangle src_rect;
MtkRectangle dst_rect;
cairo_region_get_rectangle (redraw_clip, i, &src_rect);
_clutter_util_rectangle_offset (&src_rect,
@ -499,7 +498,7 @@ clutter_stage_view_after_paint (ClutterStageView *view,
}
static gboolean
is_tile_dirty (cairo_rectangle_int_t *tile,
is_tile_dirty (MtkRectangle *tile,
uint8_t *current_data,
uint8_t *prev_data,
int bpp,
@ -532,8 +531,8 @@ find_damaged_tiles (ClutterStageView *view,
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
cairo_region_t *tile_damage_region;
cairo_rectangle_int_t damage_extents;
cairo_rectangle_int_t fb_rect;
MtkRectangle damage_extents;
MtkRectangle fb_rect;
int prev_dma_buf_idx;
CoglDmaBufHandle *prev_dma_buf_handle;
uint8_t *prev_data;
@ -572,7 +571,7 @@ find_damaged_tiles (ClutterStageView *view,
if (!current_data)
goto err_mmap_current;
fb_rect = (cairo_rectangle_int_t) {
fb_rect = (MtkRectangle) {
.width = width,
.height = height,
};
@ -592,7 +591,7 @@ find_damaged_tiles (ClutterStageView *view,
{
for (tile_x = tile_x_min; tile_x <= tile_x_max; tile_x++)
{
cairo_rectangle_int_t tile = {
MtkRectangle tile = {
.x = tile_x * tile_size,
.y = tile_y * tile_size,
.width = tile_size,
@ -676,7 +675,7 @@ copy_shadowfb_to_onscreen (ClutterStageView *view,
if (cairo_region_is_empty (swap_region))
{
cairo_rectangle_int_t full_damage = {
MtkRectangle full_damage = {
.width = cogl_framebuffer_get_width (priv->framebuffer),
.height = cogl_framebuffer_get_height (priv->framebuffer),
};
@ -748,7 +747,7 @@ copy_shadowfb_to_onscreen (ClutterStageView *view,
{
CoglFramebuffer *shadowfb = COGL_FRAMEBUFFER (priv->shadow.framebuffer);
g_autoptr (GError) error = NULL;
cairo_rectangle_int_t rect;
MtkRectangle rect;
cairo_region_get_rectangle (damage_region, i, &rect);
@ -941,7 +940,7 @@ maybe_mark_full_redraw (ClutterStageView *view,
if (cairo_region_num_rectangles (*region) == 1)
{
cairo_rectangle_int_t region_extents;
MtkRectangle region_extents;
cairo_region_get_extents (*region, &region_extents);
if (clutter_util_rectangle_equal (&priv->layout, &region_extents))
@ -951,7 +950,7 @@ maybe_mark_full_redraw (ClutterStageView *view,
void
clutter_stage_view_add_redraw_clip (ClutterStageView *view,
const cairo_rectangle_int_t *clip)
const MtkRectangle *clip)
{
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
@ -1410,8 +1409,7 @@ clutter_stage_view_set_property (GObject *object,
ClutterStageView *view = CLUTTER_STAGE_VIEW (object);
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
cairo_rectangle_int_t *layout;
MtkRectangle *layout;
switch (prop_id)
{
case PROP_NAME:
@ -1552,7 +1550,7 @@ clutter_stage_view_class_init (ClutterStageViewClass *klass)
obj_props[PROP_LAYOUT] =
g_param_spec_boxed ("layout", NULL, NULL,
CAIRO_GOBJECT_TYPE_RECTANGLE_INT,
MTK_TYPE_RECTANGLE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS);

View File

@ -21,13 +21,13 @@
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include <cairo.h>
#include <glib-object.h>
#include "cogl/cogl.h"
#include "clutter/clutter-macros.h"
#include "clutter/clutter-frame-clock.h"
#include "clutter/clutter-types.h"
#include "mtk/mtk.h"
#define CLUTTER_TYPE_STAGE_VIEW (clutter_stage_view_get_type ())
CLUTTER_EXPORT
@ -46,10 +46,10 @@ struct _ClutterStageViewClass
graphene_matrix_t *matrix);
void (* transform_rect_to_onscreen) (ClutterStageView *view,
const cairo_rectangle_int_t *src_rect,
const MtkRectangle *src_rect,
int dst_width,
int dst_height,
cairo_rectangle_int_t *dst_rect);
MtkRectangle *dst_rect);
ClutterFrame * (* new_frame) (ClutterStageView *view);
@ -61,7 +61,7 @@ void clutter_stage_view_destroy (ClutterStageView *view);
CLUTTER_EXPORT
void clutter_stage_view_get_layout (ClutterStageView *view,
cairo_rectangle_int_t *rect);
MtkRectangle *rect);
CLUTTER_EXPORT
CoglFramebuffer *clutter_stage_view_get_framebuffer (ClutterStageView *view);

View File

@ -80,7 +80,7 @@ _clutter_stage_window_resize (ClutterStageWindow *window,
void
_clutter_stage_window_get_geometry (ClutterStageWindow *window,
cairo_rectangle_int_t *geometry)
MtkRectangle *geometry)
{
CLUTTER_STAGE_WINDOW_GET_IFACE (window)->get_geometry (window, geometry);
}

View File

@ -39,7 +39,7 @@ struct _ClutterStageWindowInterface
gint width,
gint height);
void (* get_geometry) (ClutterStageWindow *stage_window,
cairo_rectangle_int_t *geometry);
MtkRectangle *geometry);
void (* redraw_view) (ClutterStageWindow *stage_window,
ClutterStageView *view,
@ -76,7 +76,7 @@ void _clutter_stage_window_resize (ClutterStageWin
gint height);
CLUTTER_EXPORT
void _clutter_stage_window_get_geometry (ClutterStageWindow *window,
cairo_rectangle_int_t *geometry);
MtkRectangle *geometry);
void _clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
gboolean accept_focus);

View File

@ -208,7 +208,7 @@ clutter_stage_get_preferred_width (ClutterActor *self,
gfloat *natural_width_p)
{
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
cairo_rectangle_int_t geom;
MtkRectangle geom;
if (priv->impl == NULL)
return;
@ -229,7 +229,7 @@ clutter_stage_get_preferred_height (ClutterActor *self,
gfloat *natural_height_p)
{
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
cairo_rectangle_int_t geom;
MtkRectangle geom;
if (priv->impl == NULL)
return;
@ -245,7 +245,7 @@ clutter_stage_get_preferred_height (ClutterActor *self,
static void
clutter_stage_add_redraw_clip (ClutterStage *stage,
cairo_rectangle_int_t *clip)
MtkRectangle *clip)
{
GList *l;
@ -259,8 +259,8 @@ clutter_stage_add_redraw_clip (ClutterStage *stage,
}
else
{
cairo_rectangle_int_t view_layout;
cairo_rectangle_int_t intersection;
MtkRectangle view_layout;
MtkRectangle intersection;
clutter_stage_view_get_layout (view, &view_layout);
if (_clutter_util_rectangle_intersection (&view_layout, clip,
@ -299,7 +299,7 @@ clutter_stage_allocate (ClutterActor *self,
ClutterActorBox alloc = CLUTTER_ACTOR_BOX_INIT_ZERO;
float new_width, new_height;
float width, height;
cairo_rectangle_int_t window_size;
MtkRectangle window_size;
ClutterActorBox children_box;
ClutterLayoutManager *layout_manager = clutter_actor_get_layout_manager (self);
@ -343,11 +343,11 @@ clutter_stage_allocate (ClutterActor *self,
static void
setup_clip_frustum (ClutterStage *stage,
const cairo_rectangle_int_t *clip,
const MtkRectangle *clip,
graphene_frustum_t *frustum)
{
ClutterStagePrivate *priv = stage->priv;
cairo_rectangle_int_t geom;
MtkRectangle geom;
graphene_point3d_t camera_position;
graphene_point3d_t p[4];
graphene_plane_t planes[6];
@ -407,7 +407,7 @@ clutter_stage_do_paint_view (ClutterStage *stage,
const cairo_region_t *redraw_clip)
{
ClutterPaintContext *paint_context;
cairo_rectangle_int_t clip_rect;
MtkRectangle clip_rect;
g_autoptr (GArray) clip_frusta = NULL;
graphene_frustum_t clip_frustum;
ClutterPaintNode *root_node;
@ -1110,7 +1110,7 @@ clutter_stage_get_view_at (ClutterStage *stage,
for (l = _clutter_stage_window_get_views (priv->impl); l; l = l->next)
{
ClutterStageView *view = l->data;
cairo_rectangle_int_t view_layout;
MtkRectangle view_layout;
clutter_stage_view_get_layout (view, &view_layout);
if (x >= view_layout.x &&
@ -1321,7 +1321,7 @@ clutter_stage_paint (ClutterActor *actor,
if (view &&
G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_MAX_RENDER_TIME))
{
cairo_rectangle_int_t view_layout;
MtkRectangle view_layout;
ClutterFrameClock *frame_clock;
g_autoptr (GString) string = NULL;
PangoLayout *layout;
@ -1642,7 +1642,7 @@ clutter_stage_class_init (ClutterStageClass *klass)
static void
clutter_stage_init (ClutterStage *self)
{
cairo_rectangle_int_t geom = { 0, };
MtkRectangle geom = { 0, };
ClutterStagePrivate *priv;
ClutterStageWindow *impl;
ClutterBackend *backend;
@ -1947,7 +1947,7 @@ clutter_stage_read_pixels (ClutterStage *stage,
GList *l;
ClutterStageView *view;
cairo_region_t *clip;
cairo_rectangle_int_t clip_rect;
MtkRectangle clip_rect;
CoglFramebuffer *framebuffer;
float view_scale;
float pixel_width;
@ -1980,7 +1980,7 @@ clutter_stage_read_pixels (ClutterStage *stage,
clutter_stage_view_get_layout (view, &clip_rect);
clip = cairo_region_create_rectangle (&clip_rect);
cairo_region_intersect_rectangle (clip,
&(cairo_rectangle_int_t) {
&(MtkRectangle) {
.x = x,
.y = y,
.width = width,
@ -2440,7 +2440,7 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
if (clutter_stage_view_is_dirty_viewport (view))
{
cairo_rectangle_int_t view_layout;
MtkRectangle view_layout;
float fb_scale;
float viewport_offset_x;
float viewport_offset_y;
@ -2593,7 +2593,7 @@ clutter_stage_add_to_redraw_clip (ClutterStage *stage,
ClutterStageWindow *stage_window;
ClutterActorBox bounding_box;
ClutterActorBox intersection_box;
cairo_rectangle_int_t geom, stage_clip;
MtkRectangle geom, stage_clip;
if (CLUTTER_ACTOR_IN_DESTRUCTION (CLUTTER_ACTOR (stage)))
return;
@ -2661,7 +2661,7 @@ clutter_stage_presented (ClutterStage *stage,
/**
* clutter_stage_get_capture_final_size:
* @stage: a #ClutterStage actor
* @rect: a #cairo_rectangle_int_t
* @rect: a rectangle
* @out_width: (out) (optional): the final width
* @out_height: (out) (optional): the final height
* @out_scale: (out) (optional): the final scale factor
@ -2674,7 +2674,7 @@ clutter_stage_presented (ClutterStage *stage,
*/
gboolean
clutter_stage_get_capture_final_size (ClutterStage *stage,
cairo_rectangle_int_t *rect,
MtkRectangle *rect,
int *out_width,
int *out_height,
float *out_scale)
@ -2733,7 +2733,7 @@ clutter_stage_get_capture_final_size (ClutterStage *stage,
void
clutter_stage_paint_to_framebuffer (ClutterStage *stage,
CoglFramebuffer *framebuffer,
const cairo_rectangle_int_t *rect,
const MtkRectangle *rect,
float scale,
ClutterPaintFlag paint_flags)
{
@ -2772,7 +2772,7 @@ clutter_stage_paint_to_framebuffer (ClutterStage *stage,
/**
* clutter_stage_paint_to_buffer:
* @stage: a #ClutterStage actor
* @rect: a #cairo_rectangle_int_t
* @rect: a rectangle
* @scale: the scale
* @data: (array) (element-type guint8): a pointer to the data
* @stride: stride of the image surface
@ -2786,7 +2786,7 @@ clutter_stage_paint_to_framebuffer (ClutterStage *stage,
*/
gboolean
clutter_stage_paint_to_buffer (ClutterStage *stage,
const cairo_rectangle_int_t *rect,
const MtkRectangle *rect,
float scale,
uint8_t *data,
int stride,
@ -2847,7 +2847,7 @@ clutter_stage_paint_to_buffer (ClutterStage *stage,
/**
* clutter_stage_paint_to_content:
* @stage: a #ClutterStage actor
* @rect: a #cairo_rectangle_int_t
* @rect: a rectangle
* @scale: the scale
* @paint_flags: the #ClutterPaintFlag
* @error: the error
@ -2858,7 +2858,7 @@ clutter_stage_paint_to_buffer (ClutterStage *stage,
*/
ClutterContent *
clutter_stage_paint_to_content (ClutterStage *stage,
const cairo_rectangle_int_t *rect,
const MtkRectangle *rect,
float scale,
ClutterPaintFlag paint_flags,
GError **error)
@ -2902,7 +2902,7 @@ clutter_stage_paint_to_content (ClutterStage *stage,
void
clutter_stage_capture_view_into (ClutterStage *stage,
ClutterStageView *view,
cairo_rectangle_int_t *rect,
MtkRectangle *rect,
uint8_t *data,
int stride)
{
@ -2910,7 +2910,7 @@ clutter_stage_capture_view_into (ClutterStage *stage,
ClutterBackend *backend;
CoglContext *context;
CoglBitmap *bitmap;
cairo_rectangle_int_t view_layout;
MtkRectangle view_layout;
float view_scale;
float texture_width;
float texture_height;
@ -2973,7 +2973,7 @@ clutter_stage_get_views_for_rect (ClutterStage *stage,
for (l = _clutter_stage_window_get_views (priv->impl); l; l = l->next)
{
ClutterStageView *view = l->data;
cairo_rectangle_int_t view_layout;
MtkRectangle view_layout;
graphene_rect_t view_rect;
clutter_stage_view_get_layout (view, &view_layout);

View File

@ -31,6 +31,7 @@
#include "clutter/clutter-grab.h"
#include "clutter/clutter-types.h"
#include "clutter/clutter-stage-view.h"
#include "mtk/mtk.h"
G_BEGIN_DECLS
@ -143,7 +144,7 @@ struct _ClutterFrameInfo
typedef struct _ClutterCapture
{
cairo_surface_t *image;
cairo_rectangle_int_t rect;
MtkRectangle rect;
} ClutterCapture;
CLUTTER_EXPORT
@ -193,7 +194,7 @@ void clutter_stage_schedule_update (ClutterStage *stage);
CLUTTER_EXPORT
gboolean clutter_stage_get_capture_final_size (ClutterStage *stage,
cairo_rectangle_int_t *rect,
MtkRectangle *rect,
int *out_width,
int *out_height,
float *out_scale);
@ -201,13 +202,13 @@ gboolean clutter_stage_get_capture_final_size (ClutterStage *stage,
CLUTTER_EXPORT
void clutter_stage_paint_to_framebuffer (ClutterStage *stage,
CoglFramebuffer *framebuffer,
const cairo_rectangle_int_t *rect,
const MtkRectangle *rect,
float scale,
ClutterPaintFlag paint_flags);
CLUTTER_EXPORT
gboolean clutter_stage_paint_to_buffer (ClutterStage *stage,
const cairo_rectangle_int_t *rect,
const MtkRectangle *rect,
float scale,
uint8_t *data,
int stride,
@ -217,7 +218,7 @@ gboolean clutter_stage_paint_to_buffer (ClutterStage *stage,
CLUTTER_EXPORT
ClutterContent * clutter_stage_paint_to_content (ClutterStage *stage,
const cairo_rectangle_int_t *rect,
const MtkRectangle *rect,
float scale,
ClutterPaintFlag paint_flags,
GError **error);

View File

@ -123,7 +123,7 @@ clutter_content_iface_init (ClutterContentInterface *iface)
*/
ClutterContent *
clutter_texture_content_new_from_texture (CoglTexture *texture,
cairo_rectangle_int_t *clip)
MtkRectangle *clip)
{
ClutterTextureContent *texture_content;
CoglContext *cogl_context =

View File

@ -32,6 +32,7 @@
#include "cogl/cogl.h"
#include "clutter/clutter-types.h"
#include "mtk/mtk.h"
G_BEGIN_DECLS
@ -42,7 +43,7 @@ G_DECLARE_FINAL_TYPE (ClutterTextureContent, clutter_texture_content,
CLUTTER_EXPORT
ClutterContent * clutter_texture_content_new_from_texture (CoglTexture *texture,
cairo_rectangle_int_t *clip);
MtkRectangle *clip);
CLUTTER_EXPORT
CoglTexture * clutter_texture_content_get_texture (ClutterTextureContent *texture_content);

View File

@ -120,7 +120,7 @@ _clutter_util_fully_transform_vertices (const graphene_matrix_t *modelview,
}
void
_clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
_clutter_util_rect_from_rectangle (const MtkRectangle *src,
graphene_rect_t *dest)
{
*dest = (graphene_rect_t) {
@ -137,13 +137,13 @@ _clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
void
_clutter_util_rectangle_int_extents (const graphene_rect_t *src,
cairo_rectangle_int_t *dest)
MtkRectangle *dest)
{
graphene_rect_t tmp = *src;
graphene_rect_round_extents (&tmp, &tmp);
*dest = (cairo_rectangle_int_t) {
*dest = (MtkRectangle) {
.x = tmp.origin.x,
.y = tmp.origin.y,
.width = tmp.size.width,
@ -152,10 +152,10 @@ _clutter_util_rectangle_int_extents (const graphene_rect_t *src,
}
void
_clutter_util_rectangle_offset (const cairo_rectangle_int_t *src,
_clutter_util_rectangle_offset (const MtkRectangle *src,
int x,
int y,
cairo_rectangle_int_t *dest)
MtkRectangle *dest)
{
*dest = *src;
@ -179,9 +179,9 @@ _clutter_util_rectangle_offset (const cairo_rectangle_int_t *src,
* This function should really be in Cairo.
*/
void
_clutter_util_rectangle_union (const cairo_rectangle_int_t *src1,
const cairo_rectangle_int_t *src2,
cairo_rectangle_int_t *dest)
_clutter_util_rectangle_union (const MtkRectangle *src1,
const MtkRectangle *src2,
MtkRectangle *dest)
{
int dest_x, dest_y;
@ -195,9 +195,9 @@ _clutter_util_rectangle_union (const cairo_rectangle_int_t *src1,
}
gboolean
_clutter_util_rectangle_intersection (const cairo_rectangle_int_t *src1,
const cairo_rectangle_int_t *src2,
cairo_rectangle_int_t *dest)
_clutter_util_rectangle_intersection (const MtkRectangle *src1,
const MtkRectangle *src2,
MtkRectangle *dest)
{
int x1, y1, x2, y2;
@ -228,8 +228,8 @@ _clutter_util_rectangle_intersection (const cairo_rectangle_int_t *src1,
}
gboolean
clutter_util_rectangle_equal (const cairo_rectangle_int_t *src1,
const cairo_rectangle_int_t *src2)
clutter_util_rectangle_equal (const MtkRectangle *src1,
const MtkRectangle *src2)
{
return ((src1->x == src2->x) &&
(src1->y == src2->y) &&

View File

@ -355,6 +355,7 @@ if have_introspection
namespace: 'Clutter',
export_packages: [libmutter_clutter_name],
includes: [
libmutter_mtk_gir[0],
libmutter_cogl_gir[0],
libmutter_cogl_pango_gir[0],
'GL-1.0',
@ -379,6 +380,7 @@ if have_introspection
header: 'cally/cally.h',
namespace: 'Cally',
includes: [
libmutter_mtk_gir[0],
libmutter_cogl_gir[0],
libmutter_cogl_pango_gir[0],
libmutter_clutter_gir[0],