mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
clutter: Replace cairo_rectangle_int_t with MtkRectangle
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
This commit is contained in:
parent
7ee5b0c3e6
commit
06b5cb0761
@ -7706,8 +7706,8 @@ _clutter_actor_queue_only_relayout (ClutterActor *self)
|
||||
* clutter_actor_queue_redraw().
|
||||
*/
|
||||
void
|
||||
clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||
const cairo_rectangle_int_t *clip)
|
||||
clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||
const MtkRectangle *clip)
|
||||
{
|
||||
ClutterPaintVolume volume;
|
||||
graphene_point3d_t origin;
|
||||
|
@ -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
|
||||
|
||||
@ -335,8 +336,8 @@ void clutter_actor_continue_pick
|
||||
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);
|
||||
void clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
||||
const MtkRectangle *clip);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_actor_queue_relayout (ClutterActor *self);
|
||||
CLUTTER_EXPORT
|
||||
|
@ -356,12 +356,12 @@ clutter_image_set_bytes (ClutterImage *image,
|
||||
* and %FALSE otherwise.
|
||||
*/
|
||||
gboolean
|
||||
clutter_image_set_area (ClutterImage *image,
|
||||
const guint8 *data,
|
||||
CoglPixelFormat pixel_format,
|
||||
const cairo_rectangle_int_t *area,
|
||||
guint row_stride,
|
||||
GError **error)
|
||||
clutter_image_set_area (ClutterImage *image,
|
||||
const guint8 *data,
|
||||
CoglPixelFormat pixel_format,
|
||||
const MtkRectangle *area,
|
||||
guint row_stride,
|
||||
GError **error)
|
||||
{
|
||||
ClutterImagePrivate *priv;
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
#include "cogl/cogl.h"
|
||||
#include "clutter/clutter-types.h"
|
||||
#include "mtk/mtk.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -61,12 +62,12 @@ gboolean clutter_image_set_data (ClutterImage
|
||||
guint row_stride,
|
||||
GError **error);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_image_set_area (ClutterImage *image,
|
||||
const guint8 *data,
|
||||
CoglPixelFormat pixel_format,
|
||||
const cairo_rectangle_int_t *rect,
|
||||
guint row_stride,
|
||||
GError **error);
|
||||
gboolean clutter_image_set_area (ClutterImage *image,
|
||||
const guint8 *data,
|
||||
CoglPixelFormat pixel_format,
|
||||
const MtkRectangle *rect,
|
||||
guint row_stride,
|
||||
GError **error);
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_image_set_bytes (ClutterImage *image,
|
||||
GBytes *data,
|
||||
|
@ -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
|
||||
@ -80,11 +81,11 @@ CLUTTER_EXPORT
|
||||
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,
|
||||
uint8_t *data,
|
||||
int stride);
|
||||
void clutter_stage_capture_view_into (ClutterStage *stage,
|
||||
ClutterStageView *view,
|
||||
MtkRectangle *rect,
|
||||
uint8_t *data,
|
||||
int stride);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_clear_stage_views (ClutterStage *stage);
|
||||
|
@ -430,8 +430,8 @@ clutter_pick_stack_pop_transform (ClutterPickStack *pick_stack)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
get_verts_rectangle (graphene_point3d_t verts[4],
|
||||
cairo_rectangle_int_t *rect)
|
||||
get_verts_rectangle (graphene_point3d_t verts[4],
|
||||
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,
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
@ -46,8 +47,8 @@ void clutter_stage_view_set_projection (ClutterStageView *view,
|
||||
const graphene_matrix_t *matrix);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_view_add_redraw_clip (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
void clutter_stage_view_add_redraw_clip (ClutterStageView *view,
|
||||
const MtkRectangle *clip);
|
||||
|
||||
gboolean clutter_stage_view_has_full_redraw_clip (ClutterStageView *view);
|
||||
|
||||
@ -68,11 +69,11 @@ CLUTTER_EXPORT
|
||||
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,
|
||||
int dst_width,
|
||||
int dst_height,
|
||||
cairo_rectangle_int_t *dst_rect);
|
||||
void clutter_stage_view_transform_rect_to_onscreen (ClutterStageView *view,
|
||||
const MtkRectangle *src_rect,
|
||||
int dst_width,
|
||||
int dst_height,
|
||||
MtkRectangle *dst_rect);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_view_schedule_update (ClutterStageView *view);
|
||||
|
@ -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;
|
||||
|
||||
@ -116,8 +115,8 @@ clutter_stage_view_destroy (ClutterStageView *view)
|
||||
}
|
||||
|
||||
void
|
||||
clutter_stage_view_get_layout (ClutterStageView *view,
|
||||
cairo_rectangle_int_t *rect)
|
||||
clutter_stage_view_get_layout (ClutterStageView *view,
|
||||
MtkRectangle *rect)
|
||||
{
|
||||
ClutterStageViewPrivate *priv =
|
||||
clutter_stage_view_get_instance_private (view);
|
||||
@ -213,11 +212,11 @@ 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,
|
||||
int dst_width,
|
||||
int dst_height,
|
||||
cairo_rectangle_int_t *dst_rect)
|
||||
clutter_stage_view_transform_rect_to_onscreen (ClutterStageView *view,
|
||||
const MtkRectangle *src_rect,
|
||||
int dst_width,
|
||||
int dst_height,
|
||||
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,11 +498,11 @@ clutter_stage_view_after_paint (ClutterStageView *view,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_tile_dirty (cairo_rectangle_int_t *tile,
|
||||
uint8_t *current_data,
|
||||
uint8_t *prev_data,
|
||||
int bpp,
|
||||
int stride)
|
||||
is_tile_dirty (MtkRectangle *tile,
|
||||
uint8_t *current_data,
|
||||
uint8_t *prev_data,
|
||||
int bpp,
|
||||
int stride)
|
||||
{
|
||||
int y;
|
||||
|
||||
@ -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, ®ion_extents);
|
||||
if (clutter_util_rectangle_equal (&priv->layout, ®ion_extents))
|
||||
@ -950,8 +949,8 @@ maybe_mark_full_redraw (ClutterStageView *view,
|
||||
}
|
||||
|
||||
void
|
||||
clutter_stage_view_add_redraw_clip (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *clip)
|
||||
clutter_stage_view_add_redraw_clip (ClutterStageView *view,
|
||||
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);
|
||||
|
@ -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
|
||||
@ -45,11 +45,11 @@ struct _ClutterStageViewClass
|
||||
void (* get_offscreen_transformation_matrix) (ClutterStageView *view,
|
||||
graphene_matrix_t *matrix);
|
||||
|
||||
void (* transform_rect_to_onscreen) (ClutterStageView *view,
|
||||
const cairo_rectangle_int_t *src_rect,
|
||||
int dst_width,
|
||||
int dst_height,
|
||||
cairo_rectangle_int_t *dst_rect);
|
||||
void (* transform_rect_to_onscreen) (ClutterStageView *view,
|
||||
const MtkRectangle *src_rect,
|
||||
int dst_width,
|
||||
int dst_height,
|
||||
MtkRectangle *dst_rect);
|
||||
|
||||
ClutterFrame * (* new_frame) (ClutterStageView *view);
|
||||
|
||||
@ -60,8 +60,8 @@ CLUTTER_EXPORT
|
||||
void clutter_stage_view_destroy (ClutterStageView *view);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_view_get_layout (ClutterStageView *view,
|
||||
cairo_rectangle_int_t *rect);
|
||||
void clutter_stage_view_get_layout (ClutterStageView *view,
|
||||
MtkRectangle *rect);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
CoglFramebuffer *clutter_stage_view_get_framebuffer (ClutterStageView *view);
|
||||
|
@ -79,8 +79,8 @@ _clutter_stage_window_resize (ClutterStageWindow *window,
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_stage_window_get_geometry (ClutterStageWindow *window,
|
||||
cairo_rectangle_int_t *geometry)
|
||||
_clutter_stage_window_get_geometry (ClutterStageWindow *window,
|
||||
MtkRectangle *geometry)
|
||||
{
|
||||
CLUTTER_STAGE_WINDOW_GET_IFACE (window)->get_geometry (window, geometry);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
@ -244,8 +244,8 @@ clutter_stage_get_preferred_height (ClutterActor *self,
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_add_redraw_clip (ClutterStage *stage,
|
||||
cairo_rectangle_int_t *clip)
|
||||
clutter_stage_add_redraw_clip (ClutterStage *stage,
|
||||
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);
|
||||
|
||||
@ -342,12 +342,12 @@ clutter_stage_allocate (ClutterActor *self,
|
||||
}
|
||||
|
||||
static void
|
||||
setup_clip_frustum (ClutterStage *stage,
|
||||
const cairo_rectangle_int_t *clip,
|
||||
graphene_frustum_t *frustum)
|
||||
setup_clip_frustum (ClutterStage *stage,
|
||||
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
|
||||
@ -2673,11 +2673,11 @@ clutter_stage_presented (ClutterStage *stage,
|
||||
* Returns: %TRUE if the size has been retrieved, %FALSE otherwise.
|
||||
*/
|
||||
gboolean
|
||||
clutter_stage_get_capture_final_size (ClutterStage *stage,
|
||||
cairo_rectangle_int_t *rect,
|
||||
int *out_width,
|
||||
int *out_height,
|
||||
float *out_scale)
|
||||
clutter_stage_get_capture_final_size (ClutterStage *stage,
|
||||
MtkRectangle *rect,
|
||||
int *out_width,
|
||||
int *out_height,
|
||||
float *out_scale)
|
||||
{
|
||||
float max_scale = 1.0;
|
||||
|
||||
@ -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
|
||||
@ -2785,14 +2785,14 @@ clutter_stage_paint_to_framebuffer (ClutterStage *stage,
|
||||
* Returns: %TRUE is the buffer has been paint successfully, %FALSE otherwise.
|
||||
*/
|
||||
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_stage_paint_to_buffer (ClutterStage *stage,
|
||||
const MtkRectangle *rect,
|
||||
float scale,
|
||||
uint8_t *data,
|
||||
int stride,
|
||||
CoglPixelFormat format,
|
||||
ClutterPaintFlag paint_flags,
|
||||
GError **error)
|
||||
{
|
||||
ClutterBackend *clutter_backend = clutter_get_default_backend ();
|
||||
CoglContext *cogl_context =
|
||||
@ -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
|
||||
@ -2857,11 +2857,11 @@ clutter_stage_paint_to_buffer (ClutterStage *stage,
|
||||
* Returns: (transfer full): the #ClutterContent or %NULL on error.
|
||||
*/
|
||||
ClutterContent *
|
||||
clutter_stage_paint_to_content (ClutterStage *stage,
|
||||
const cairo_rectangle_int_t *rect,
|
||||
float scale,
|
||||
ClutterPaintFlag paint_flags,
|
||||
GError **error)
|
||||
clutter_stage_paint_to_content (ClutterStage *stage,
|
||||
const MtkRectangle *rect,
|
||||
float scale,
|
||||
ClutterPaintFlag paint_flags,
|
||||
GError **error)
|
||||
{
|
||||
ClutterBackend *clutter_backend = clutter_get_default_backend ();
|
||||
CoglContext *cogl_context =
|
||||
@ -2900,17 +2900,17 @@ clutter_stage_paint_to_content (ClutterStage *stage,
|
||||
}
|
||||
|
||||
void
|
||||
clutter_stage_capture_view_into (ClutterStage *stage,
|
||||
ClutterStageView *view,
|
||||
cairo_rectangle_int_t *rect,
|
||||
uint8_t *data,
|
||||
int stride)
|
||||
clutter_stage_capture_view_into (ClutterStage *stage,
|
||||
ClutterStageView *view,
|
||||
MtkRectangle *rect,
|
||||
uint8_t *data,
|
||||
int stride)
|
||||
{
|
||||
CoglFramebuffer *framebuffer;
|
||||
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);
|
||||
|
@ -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
|
||||
@ -192,35 +193,35 @@ CLUTTER_EXPORT
|
||||
void clutter_stage_schedule_update (ClutterStage *stage);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
gboolean clutter_stage_get_capture_final_size (ClutterStage *stage,
|
||||
cairo_rectangle_int_t *rect,
|
||||
int *out_width,
|
||||
int *out_height,
|
||||
float *out_scale);
|
||||
gboolean clutter_stage_get_capture_final_size (ClutterStage *stage,
|
||||
MtkRectangle *rect,
|
||||
int *out_width,
|
||||
int *out_height,
|
||||
float *out_scale);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_paint_to_framebuffer (ClutterStage *stage,
|
||||
CoglFramebuffer *framebuffer,
|
||||
const cairo_rectangle_int_t *rect,
|
||||
float scale,
|
||||
ClutterPaintFlag paint_flags);
|
||||
void clutter_stage_paint_to_framebuffer (ClutterStage *stage,
|
||||
CoglFramebuffer *framebuffer,
|
||||
const MtkRectangle *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);
|
||||
gboolean clutter_stage_paint_to_buffer (ClutterStage *stage,
|
||||
const MtkRectangle *rect,
|
||||
float scale,
|
||||
uint8_t *data,
|
||||
int stride,
|
||||
CoglPixelFormat format,
|
||||
ClutterPaintFlag paint_flags,
|
||||
GError **error);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterContent * clutter_stage_paint_to_content (ClutterStage *stage,
|
||||
const cairo_rectangle_int_t *rect,
|
||||
float scale,
|
||||
ClutterPaintFlag paint_flags,
|
||||
GError **error);
|
||||
ClutterContent * clutter_stage_paint_to_content (ClutterStage *stage,
|
||||
const MtkRectangle *rect,
|
||||
float scale,
|
||||
ClutterPaintFlag paint_flags,
|
||||
GError **error);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterStageView * clutter_stage_get_view_at (ClutterStage *stage,
|
||||
|
@ -122,8 +122,8 @@ clutter_content_iface_init (ClutterContentInterface *iface)
|
||||
* Use [method@GObject.Object.unref] when done.
|
||||
*/
|
||||
ClutterContent *
|
||||
clutter_texture_content_new_from_texture (CoglTexture *texture,
|
||||
cairo_rectangle_int_t *clip)
|
||||
clutter_texture_content_new_from_texture (CoglTexture *texture,
|
||||
MtkRectangle *clip)
|
||||
{
|
||||
ClutterTextureContent *texture_content;
|
||||
CoglContext *cogl_context =
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
#include "cogl/cogl.h"
|
||||
#include "clutter/clutter-types.h"
|
||||
#include "mtk/mtk.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -41,8 +42,8 @@ G_DECLARE_FINAL_TYPE (ClutterTextureContent, clutter_texture_content,
|
||||
CLUTTER, TEXTURE_CONTENT, GObject)
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterContent * clutter_texture_content_new_from_texture (CoglTexture *texture,
|
||||
cairo_rectangle_int_t *clip);
|
||||
ClutterContent * clutter_texture_content_new_from_texture (CoglTexture *texture,
|
||||
MtkRectangle *clip);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
CoglTexture * clutter_texture_content_get_texture (ClutterTextureContent *texture_content);
|
||||
|
@ -120,8 +120,8 @@ _clutter_util_fully_transform_vertices (const graphene_matrix_t *modelview,
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_util_rect_from_rectangle (const cairo_rectangle_int_t *src,
|
||||
graphene_rect_t *dest)
|
||||
_clutter_util_rect_from_rectangle (const MtkRectangle *src,
|
||||
graphene_rect_t *dest)
|
||||
{
|
||||
*dest = (graphene_rect_t) {
|
||||
.origin = {
|
||||
@ -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,
|
||||
int x,
|
||||
int y,
|
||||
cairo_rectangle_int_t *dest)
|
||||
_clutter_util_rectangle_offset (const MtkRectangle *src,
|
||||
int x,
|
||||
int y,
|
||||
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) &&
|
||||
|
@ -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],
|
||||
|
Loading…
Reference in New Issue
Block a user