mutter: Replace cairo_rectangle_int_t with MtkRectangle
Note: the various helpers in boxes.c were not ported yet, see the next commit. This was intentionally done to simplify the porting process Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
This commit is contained in:
parent
c1703337e4
commit
918ae0f4d4
@ -35,6 +35,7 @@
|
|||||||
#include "core/boxes-private.h"
|
#include "core/boxes-private.h"
|
||||||
#include "meta/meta-backend.h"
|
#include "meta/meta-backend.h"
|
||||||
#include "meta/util.h"
|
#include "meta/util.h"
|
||||||
|
#include "mtk/mtk.h"
|
||||||
|
|
||||||
G_DEFINE_INTERFACE (MetaHwCursorInhibitor, meta_hw_cursor_inhibitor,
|
G_DEFINE_INTERFACE (MetaHwCursorInhibitor, meta_hw_cursor_inhibitor,
|
||||||
G_TYPE_OBJECT)
|
G_TYPE_OBJECT)
|
||||||
@ -109,7 +110,7 @@ align_cursor_position (MetaCursorRenderer *renderer,
|
|||||||
meta_cursor_renderer_get_instance_private (renderer);
|
meta_cursor_renderer_get_instance_private (renderer);
|
||||||
ClutterActor *stage = meta_backend_get_stage (priv->backend);
|
ClutterActor *stage = meta_backend_get_stage (priv->backend);
|
||||||
ClutterStageView *view;
|
ClutterStageView *view;
|
||||||
cairo_rectangle_int_t view_layout;
|
MtkRectangle view_layout;
|
||||||
float view_scale;
|
float view_scale;
|
||||||
|
|
||||||
view = clutter_stage_get_view_at (CLUTTER_STAGE (stage),
|
view = clutter_stage_get_view_at (CLUTTER_STAGE (stage),
|
||||||
|
@ -221,7 +221,7 @@ configure_abs (MetaEisClient *meta_eis_client,
|
|||||||
struct eis_device *eis_device)
|
struct eis_device *eis_device)
|
||||||
{
|
{
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
float scale;
|
float scale;
|
||||||
|
|
||||||
if (!meta_eis_client->viewports)
|
if (!meta_eis_client->viewports)
|
||||||
|
@ -187,7 +187,7 @@ ensure_eis_pointer_regions (MetaInputCaptureSession *session,
|
|||||||
struct eis_device *eis_pointer)
|
struct eis_device *eis_pointer)
|
||||||
{
|
{
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
float scale;
|
float scale;
|
||||||
|
|
||||||
if (!session->viewports)
|
if (!session->viewports)
|
||||||
|
@ -4019,7 +4019,7 @@ meta_monitor_manager_get_viewports (MetaMonitorManager *manager)
|
|||||||
GArray *views, *scales;
|
GArray *views, *scales;
|
||||||
GList *logical_monitors, *l;
|
GList *logical_monitors, *l;
|
||||||
|
|
||||||
views = g_array_new (FALSE, FALSE, sizeof (cairo_rectangle_int_t));
|
views = g_array_new (FALSE, FALSE, sizeof (MtkRectangle));
|
||||||
scales = g_array_new (FALSE, FALSE, sizeof (float));
|
scales = g_array_new (FALSE, FALSE, sizeof (float));
|
||||||
|
|
||||||
logical_monitors = meta_monitor_manager_get_logical_monitors (manager);
|
logical_monitors = meta_monitor_manager_get_logical_monitors (manager);
|
||||||
@ -4027,7 +4027,7 @@ meta_monitor_manager_get_viewports (MetaMonitorManager *manager)
|
|||||||
for (l = logical_monitors; l; l = l->next)
|
for (l = logical_monitors; l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaLogicalMonitor *logical_monitor = l->data;
|
MetaLogicalMonitor *logical_monitor = l->data;
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
float scale;
|
float scale;
|
||||||
|
|
||||||
rect = logical_monitor->rect;
|
rect = logical_monitor->rect;
|
||||||
@ -4037,7 +4037,7 @@ meta_monitor_manager_get_viewports (MetaMonitorManager *manager)
|
|||||||
g_array_append_val (scales, scale);
|
g_array_append_val (scales, scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
info = meta_viewport_info_new ((cairo_rectangle_int_t *) views->data,
|
info = meta_viewport_info_new ((MtkRectangle *) views->data,
|
||||||
(float *) scales->data,
|
(float *) scales->data,
|
||||||
views->len,
|
views->len,
|
||||||
meta_backend_is_stage_views_scaled (backend));
|
meta_backend_is_stage_views_scaled (backend));
|
||||||
|
@ -103,10 +103,10 @@ meta_renderer_view_setup_offscreen_blit_pipeline (ClutterStageView *view,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
meta_renderer_view_transform_rect_to_onscreen (ClutterStageView *view,
|
meta_renderer_view_transform_rect_to_onscreen (ClutterStageView *view,
|
||||||
const cairo_rectangle_int_t *src_rect,
|
const MtkRectangle *src_rect,
|
||||||
int dst_width,
|
int dst_width,
|
||||||
int dst_height,
|
int dst_height,
|
||||||
cairo_rectangle_int_t *dst_rect)
|
MtkRectangle *dst_rect)
|
||||||
{
|
{
|
||||||
MetaRendererView *renderer_view = META_RENDERER_VIEW (view);
|
MetaRendererView *renderer_view = META_RENDERER_VIEW (view);
|
||||||
MetaRendererViewPrivate *priv =
|
MetaRendererViewPrivate *priv =
|
||||||
|
@ -655,7 +655,7 @@ meta_screen_cast_monitor_stream_record_follow_up (MetaScreenCastStreamSrc *src)
|
|||||||
if (!meta_rectangle_overlap (&logical_monitor_layout, &view_layout))
|
if (!meta_rectangle_overlap (&logical_monitor_layout, &view_layout))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
damage = (cairo_rectangle_int_t) {
|
damage = (MtkRectangle) {
|
||||||
.x = view_layout.x,
|
.x = view_layout.x,
|
||||||
.y = view_layout.y,
|
.y = view_layout.y,
|
||||||
.width = 1,
|
.width = 1,
|
||||||
|
@ -708,7 +708,7 @@ maybe_add_damaged_regions_metadata (MetaScreenCastStreamSrc *src,
|
|||||||
{
|
{
|
||||||
spa_meta_for_each (meta_region, spa_meta_video_damage)
|
spa_meta_for_each (meta_region, spa_meta_video_damage)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
cairo_region_get_rectangle (priv->redraw_clip, i, &rect);
|
cairo_region_get_rectangle (priv->redraw_clip, i, &rect);
|
||||||
meta_region->region = SPA_REGION (rect.x, rect.y,
|
meta_region->region = SPA_REGION (rect.x, rect.y,
|
||||||
|
@ -163,7 +163,7 @@ paint_damage_region (ClutterStageWindow *stage_window,
|
|||||||
n_rects = cairo_region_num_rectangles (swap_region);
|
n_rects = cairo_region_num_rectangles (swap_region);
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
float x_1, x_2, y_1, y_2;
|
float x_1, x_2, y_1, y_2;
|
||||||
|
|
||||||
cairo_region_get_rectangle (swap_region, i, &rect);
|
cairo_region_get_rectangle (swap_region, i, &rect);
|
||||||
@ -189,7 +189,7 @@ paint_damage_region (ClutterStageWindow *stage_window,
|
|||||||
n_rects = cairo_region_num_rectangles (queued_redraw_clip);
|
n_rects = cairo_region_num_rectangles (queued_redraw_clip);
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
float x_1, x_2, y_1, y_2;
|
float x_1, x_2, y_1, y_2;
|
||||||
|
|
||||||
cairo_region_get_rectangle (queued_redraw_clip, i, &rect);
|
cairo_region_get_rectangle (queued_redraw_clip, i, &rect);
|
||||||
@ -237,7 +237,7 @@ queue_damage_region (ClutterStageWindow *stage_window,
|
|||||||
|
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
cairo_region_get_rectangle (damage_region, i, &rect);
|
cairo_region_get_rectangle (damage_region, i, &rect);
|
||||||
|
|
||||||
@ -283,7 +283,7 @@ swap_framebuffer (ClutterStageWindow *stage_window,
|
|||||||
damage = g_newa (int, n_rects * 4);
|
damage = g_newa (int, n_rects * 4);
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
cairo_region_get_rectangle (swap_region, i, &rect);
|
cairo_region_get_rectangle (swap_region, i, &rect);
|
||||||
damage[i * 4] = rect.x;
|
damage[i * 4] = rect.x;
|
||||||
@ -346,8 +346,8 @@ offset_scale_and_clamp_region (const cairo_region_t *region,
|
|||||||
float scale)
|
float scale)
|
||||||
{
|
{
|
||||||
int n_rects, i;
|
int n_rects, i;
|
||||||
cairo_rectangle_int_t *rects;
|
MtkRectangle *rects;
|
||||||
g_autofree cairo_rectangle_int_t *freeme = NULL;
|
g_autofree MtkRectangle *freeme = NULL;
|
||||||
|
|
||||||
n_rects = cairo_region_num_rectangles (region);
|
n_rects = cairo_region_num_rectangles (region);
|
||||||
|
|
||||||
@ -355,13 +355,13 @@ offset_scale_and_clamp_region (const cairo_region_t *region,
|
|||||||
return cairo_region_create ();
|
return cairo_region_create ();
|
||||||
|
|
||||||
if (n_rects < MAX_STACK_RECTS)
|
if (n_rects < MAX_STACK_RECTS)
|
||||||
rects = g_newa (cairo_rectangle_int_t, n_rects);
|
rects = g_newa (MtkRectangle, n_rects);
|
||||||
else
|
else
|
||||||
rects = freeme = g_new (cairo_rectangle_int_t, n_rects);
|
rects = freeme = g_new (MtkRectangle, n_rects);
|
||||||
|
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t *rect = &rects[i];
|
MtkRectangle *rect = &rects[i];
|
||||||
graphene_rect_t tmp;
|
graphene_rect_t tmp;
|
||||||
|
|
||||||
cairo_region_get_rectangle (region, i, rect);
|
cairo_region_get_rectangle (region, i, rect);
|
||||||
@ -382,8 +382,8 @@ scale_offset_and_clamp_region (const cairo_region_t *region,
|
|||||||
int offset_y)
|
int offset_y)
|
||||||
{
|
{
|
||||||
int n_rects, i;
|
int n_rects, i;
|
||||||
cairo_rectangle_int_t *rects;
|
MtkRectangle *rects;
|
||||||
g_autofree cairo_rectangle_int_t *freeme = NULL;
|
g_autofree MtkRectangle *freeme = NULL;
|
||||||
|
|
||||||
n_rects = cairo_region_num_rectangles (region);
|
n_rects = cairo_region_num_rectangles (region);
|
||||||
|
|
||||||
@ -391,13 +391,13 @@ scale_offset_and_clamp_region (const cairo_region_t *region,
|
|||||||
return cairo_region_create ();
|
return cairo_region_create ();
|
||||||
|
|
||||||
if (n_rects < MAX_STACK_RECTS)
|
if (n_rects < MAX_STACK_RECTS)
|
||||||
rects = g_newa (cairo_rectangle_int_t, n_rects);
|
rects = g_newa (MtkRectangle, n_rects);
|
||||||
else
|
else
|
||||||
rects = freeme = g_new (cairo_rectangle_int_t, n_rects);
|
rects = freeme = g_new (MtkRectangle, n_rects);
|
||||||
|
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t *rect = &rects[i];
|
MtkRectangle *rect = &rects[i];
|
||||||
graphene_rect_t tmp;
|
graphene_rect_t tmp;
|
||||||
|
|
||||||
cairo_region_get_rectangle (region, i, rect);
|
cairo_region_get_rectangle (region, i, rect);
|
||||||
@ -431,7 +431,7 @@ transform_swap_region_to_onscreen (ClutterStageView *stage_view,
|
|||||||
{
|
{
|
||||||
CoglFramebuffer *onscreen = clutter_stage_view_get_onscreen (stage_view);
|
CoglFramebuffer *onscreen = clutter_stage_view_get_onscreen (stage_view);
|
||||||
int n_rects, i;
|
int n_rects, i;
|
||||||
cairo_rectangle_int_t *rects;
|
MtkRectangle *rects;
|
||||||
cairo_region_t *transformed_region;
|
cairo_region_t *transformed_region;
|
||||||
int width, height;
|
int width, height;
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ transform_swap_region_to_onscreen (ClutterStageView *stage_view,
|
|||||||
height = cogl_framebuffer_get_height (onscreen);
|
height = cogl_framebuffer_get_height (onscreen);
|
||||||
|
|
||||||
n_rects = cairo_region_num_rectangles (swap_region);
|
n_rects = cairo_region_num_rectangles (swap_region);
|
||||||
rects = g_newa (cairo_rectangle_int_t, n_rects);
|
rects = g_newa (MtkRectangle, n_rects);
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_region_get_rectangle (swap_region, i, &rects[i]);
|
cairo_region_get_rectangle (swap_region, i, &rects[i]);
|
||||||
@ -503,7 +503,7 @@ meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
|
|||||||
MetaStageView *view = META_STAGE_VIEW (stage_view);
|
MetaStageView *view = META_STAGE_VIEW (stage_view);
|
||||||
CoglFramebuffer *fb = clutter_stage_view_get_framebuffer (stage_view);
|
CoglFramebuffer *fb = clutter_stage_view_get_framebuffer (stage_view);
|
||||||
CoglFramebuffer *onscreen = clutter_stage_view_get_onscreen (stage_view);
|
CoglFramebuffer *onscreen = clutter_stage_view_get_onscreen (stage_view);
|
||||||
cairo_rectangle_int_t view_rect;
|
MtkRectangle view_rect;
|
||||||
gboolean is_full_redraw;
|
gboolean is_full_redraw;
|
||||||
gboolean use_clipped_redraw;
|
gboolean use_clipped_redraw;
|
||||||
gboolean buffer_has_valid_damage_history = FALSE;
|
gboolean buffer_has_valid_damage_history = FALSE;
|
||||||
@ -574,9 +574,9 @@ meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t fb_rect;
|
MtkRectangle fb_rect;
|
||||||
|
|
||||||
fb_rect = (cairo_rectangle_int_t) {
|
fb_rect = (MtkRectangle) {
|
||||||
.width = fb_width,
|
.width = fb_width,
|
||||||
.height = fb_height,
|
.height = fb_height,
|
||||||
};
|
};
|
||||||
|
@ -371,7 +371,7 @@ queue_redraw_clutter_rect (MetaStage *stage,
|
|||||||
MetaOverlay *overlay,
|
MetaOverlay *overlay,
|
||||||
graphene_rect_t *rect)
|
graphene_rect_t *rect)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t clip = {
|
MtkRectangle clip = {
|
||||||
.x = floorf (rect->origin.x),
|
.x = floorf (rect->origin.x),
|
||||||
.y = floorf (rect->origin.y),
|
.y = floorf (rect->origin.y),
|
||||||
.width = ceilf (rect->size.width),
|
.width = ceilf (rect->size.width),
|
||||||
@ -389,8 +389,8 @@ queue_redraw_clutter_rect (MetaStage *stage,
|
|||||||
l = l->next)
|
l = l->next)
|
||||||
{
|
{
|
||||||
ClutterStageView *view = l->data;
|
ClutterStageView *view = l->data;
|
||||||
cairo_rectangle_int_t view_layout;
|
MtkRectangle view_layout;
|
||||||
cairo_rectangle_int_t view_clip;
|
MtkRectangle view_clip;
|
||||||
|
|
||||||
if (clutter_stage_view_get_default_paint_flags (view) &
|
if (clutter_stage_view_get_default_paint_flags (view) &
|
||||||
CLUTTER_PAINT_FLAG_NO_CURSORS)
|
CLUTTER_PAINT_FLAG_NO_CURSORS)
|
||||||
|
@ -65,7 +65,7 @@ meta_viewport_info_init (MetaViewportInfo *info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MetaViewportInfo *
|
MetaViewportInfo *
|
||||||
meta_viewport_info_new (cairo_rectangle_int_t *views,
|
meta_viewport_info_new (MtkRectangle *views,
|
||||||
float *scales,
|
float *scales,
|
||||||
int n_views,
|
int n_views,
|
||||||
gboolean is_views_scaled)
|
gboolean is_views_scaled)
|
||||||
@ -110,7 +110,7 @@ meta_viewport_info_get_view_at (MetaViewportInfo *viewport_info,
|
|||||||
gboolean
|
gboolean
|
||||||
meta_viewport_info_get_view_info (MetaViewportInfo *viewport_info,
|
meta_viewport_info_get_view_info (MetaViewportInfo *viewport_info,
|
||||||
int idx,
|
int idx,
|
||||||
cairo_rectangle_int_t *rect,
|
MtkRectangle *rect,
|
||||||
float *scale)
|
float *scale)
|
||||||
{
|
{
|
||||||
ViewInfo *info;
|
ViewInfo *info;
|
||||||
@ -128,8 +128,8 @@ meta_viewport_info_get_view_info (MetaViewportInfo *viewport_info,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
view_has_neighbor (cairo_rectangle_int_t *view,
|
view_has_neighbor (MtkRectangle *view,
|
||||||
cairo_rectangle_int_t *neighbor,
|
MtkRectangle *neighbor,
|
||||||
MetaDisplayDirection neighbor_direction)
|
MetaDisplayDirection neighbor_direction)
|
||||||
{
|
{
|
||||||
switch (neighbor_direction)
|
switch (neighbor_direction)
|
||||||
@ -164,7 +164,7 @@ meta_viewport_info_get_neighbor (MetaViewportInfo *viewport_info,
|
|||||||
int idx,
|
int idx,
|
||||||
MetaDisplayDirection direction)
|
MetaDisplayDirection direction)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!meta_viewport_info_get_view_info (viewport_info, idx, &rect, NULL))
|
if (!meta_viewport_info_get_view_info (viewport_info, idx, &rect, NULL))
|
||||||
|
@ -20,16 +20,16 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cairo.h>
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "meta/display.h"
|
#include "meta/display.h"
|
||||||
|
#include "mtk/mtk.h"
|
||||||
|
|
||||||
#define META_TYPE_VIEWPORT_INFO (meta_viewport_info_get_type ())
|
#define META_TYPE_VIEWPORT_INFO (meta_viewport_info_get_type ())
|
||||||
G_DECLARE_FINAL_TYPE (MetaViewportInfo, meta_viewport_info,
|
G_DECLARE_FINAL_TYPE (MetaViewportInfo, meta_viewport_info,
|
||||||
META, VIEWPORT_INFO, GObject)
|
META, VIEWPORT_INFO, GObject)
|
||||||
|
|
||||||
MetaViewportInfo * meta_viewport_info_new (cairo_rectangle_int_t *views,
|
MetaViewportInfo * meta_viewport_info_new (MtkRectangle *views,
|
||||||
float *scales,
|
float *scales,
|
||||||
int n_views,
|
int n_views,
|
||||||
gboolean is_views_scaled);
|
gboolean is_views_scaled);
|
||||||
@ -40,7 +40,7 @@ int meta_viewport_info_get_view_at (MetaViewportInfo *info,
|
|||||||
|
|
||||||
gboolean meta_viewport_info_get_view_info (MetaViewportInfo *viewport_info,
|
gboolean meta_viewport_info_get_view_info (MetaViewportInfo *viewport_info,
|
||||||
int idx,
|
int idx,
|
||||||
cairo_rectangle_int_t *rect,
|
MtkRectangle *rect,
|
||||||
float *scale);
|
float *scale);
|
||||||
|
|
||||||
int meta_viewport_info_get_neighbor (MetaViewportInfo *info,
|
int meta_viewport_info_get_neighbor (MetaViewportInfo *info,
|
||||||
|
@ -253,7 +253,7 @@ region_to_outline (cairo_region_t *region,
|
|||||||
boxes = g_new (MetaBox, num_boxes);
|
boxes = g_new (MetaBox, num_boxes);
|
||||||
for (i = 0; i < num_boxes; i++)
|
for (i = 0; i < num_boxes; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
cairo_region_get_rectangle (region, i, &rect);
|
cairo_region_get_rectangle (region, i, &rect);
|
||||||
boxes[i] = (MetaBox) {
|
boxes[i] = (MetaBox) {
|
||||||
.x1 = rect.x,
|
.x1 = rect.x,
|
||||||
|
@ -1124,7 +1124,7 @@ constrain_all_screen_monitors (ClutterInputDevice *device,
|
|||||||
for (i = 0; i < n_views; i++)
|
for (i = 0; i < n_views; i++)
|
||||||
{
|
{
|
||||||
int left, right, top, bottom;
|
int left, right, top, bottom;
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
meta_viewport_info_get_view_info (viewports, i, &rect, NULL);
|
meta_viewport_info_get_view_info (viewports, i, &rect, NULL);
|
||||||
|
|
||||||
@ -1214,7 +1214,7 @@ relative_motion_across_outputs (MetaViewportInfo *viewports,
|
|||||||
MetaLine2 left, right, top, bottom, motion;
|
MetaLine2 left, right, top, bottom, motion;
|
||||||
MetaVector2 intersection;
|
MetaVector2 intersection;
|
||||||
MetaDisplayDirection direction;
|
MetaDisplayDirection direction;
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
float scale;
|
float scale;
|
||||||
|
|
||||||
meta_viewport_info_get_view_info (viewports, cur_view, &rect, &scale);
|
meta_viewport_info_get_view_info (viewports, cur_view, &rect, &scale);
|
||||||
@ -3664,7 +3664,7 @@ ensure_pointer_onscreen (MetaSeatImpl *seat_impl)
|
|||||||
{
|
{
|
||||||
int i, candidate = -1;
|
int i, candidate = -1;
|
||||||
int nearest_monitor_x, nearest_monitor_y, min_distance = G_MAXINT;
|
int nearest_monitor_x, nearest_monitor_y, min_distance = G_MAXINT;
|
||||||
cairo_rectangle_int_t monitor_rect;
|
MtkRectangle monitor_rect;
|
||||||
graphene_point_t coords;
|
graphene_point_t coords;
|
||||||
|
|
||||||
if (!meta_seat_impl_query_state (seat_impl,
|
if (!meta_seat_impl_query_state (seat_impl,
|
||||||
|
@ -74,7 +74,7 @@ meta_stage_native_can_clip_redraws (ClutterStageWindow *stage_window)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
meta_stage_native_get_geometry (ClutterStageWindow *stage_window,
|
meta_stage_native_get_geometry (ClutterStageWindow *stage_window,
|
||||||
cairo_rectangle_int_t *geometry)
|
MtkRectangle *geometry)
|
||||||
{
|
{
|
||||||
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_window);
|
MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_window);
|
||||||
MetaBackend *backend = meta_stage_impl_get_backend (stage_impl);
|
MetaBackend *backend = meta_stage_impl_get_backend (stage_impl);
|
||||||
@ -86,14 +86,14 @@ meta_stage_native_get_geometry (ClutterStageWindow *stage_window,
|
|||||||
int width, height;
|
int width, height;
|
||||||
|
|
||||||
meta_monitor_manager_get_screen_size (monitor_manager, &width, &height);
|
meta_monitor_manager_get_screen_size (monitor_manager, &width, &height);
|
||||||
*geometry = (cairo_rectangle_int_t) {
|
*geometry = (MtkRectangle) {
|
||||||
.width = width,
|
.width = width,
|
||||||
.height = height,
|
.height = height,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*geometry = (cairo_rectangle_int_t) {
|
*geometry = (MtkRectangle) {
|
||||||
.width = 1,
|
.width = 1,
|
||||||
.height = 1,
|
.height = 1,
|
||||||
};
|
};
|
||||||
|
@ -43,11 +43,11 @@ meta_renderer_x11_cm_init_screen_view (MetaRendererX11Cm *renderer_x11_cm,
|
|||||||
MetaRenderer *renderer = META_RENDERER (renderer_x11_cm);
|
MetaRenderer *renderer = META_RENDERER (renderer_x11_cm);
|
||||||
MetaBackend *backend = meta_renderer_get_backend (renderer);
|
MetaBackend *backend = meta_renderer_get_backend (renderer);
|
||||||
ClutterActor *stage = meta_backend_get_stage (backend);
|
ClutterActor *stage = meta_backend_get_stage (backend);
|
||||||
cairo_rectangle_int_t view_layout;
|
MtkRectangle view_layout;
|
||||||
|
|
||||||
g_return_if_fail (!renderer_x11_cm->screen_view);
|
g_return_if_fail (!renderer_x11_cm->screen_view);
|
||||||
|
|
||||||
view_layout = (cairo_rectangle_int_t) {
|
view_layout = (MtkRectangle) {
|
||||||
.width = width,
|
.width = width,
|
||||||
.height = height,
|
.height = height,
|
||||||
};
|
};
|
||||||
@ -66,9 +66,9 @@ meta_renderer_x11_cm_resize (MetaRendererX11Cm *renderer_x11_cm,
|
|||||||
int width,
|
int width,
|
||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t view_layout;
|
MtkRectangle view_layout;
|
||||||
|
|
||||||
view_layout = (cairo_rectangle_int_t) {
|
view_layout = (MtkRectangle) {
|
||||||
.width = width,
|
.width = width,
|
||||||
.height = height,
|
.height = height,
|
||||||
};
|
};
|
||||||
|
@ -137,7 +137,7 @@ meta_stage_x11_set_wm_protocols (MetaStageX11 *stage_x11)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
meta_stage_x11_get_geometry (ClutterStageWindow *stage_window,
|
meta_stage_x11_get_geometry (ClutterStageWindow *stage_window,
|
||||||
cairo_rectangle_int_t *geometry)
|
MtkRectangle *geometry)
|
||||||
{
|
{
|
||||||
MetaStageX11 *stage_x11 = META_STAGE_X11 (stage_window);
|
MetaStageX11 *stage_x11 = META_STAGE_X11 (stage_window);
|
||||||
|
|
||||||
@ -765,7 +765,7 @@ meta_stage_x11_handle_event (MetaStageX11 *stage_x11,
|
|||||||
case Expose:
|
case Expose:
|
||||||
{
|
{
|
||||||
XExposeEvent *expose = (XExposeEvent *) xevent;
|
XExposeEvent *expose = (XExposeEvent *) xevent;
|
||||||
cairo_rectangle_int_t clip;
|
MtkRectangle clip;
|
||||||
|
|
||||||
g_debug ("expose for stage: win:0x%x - "
|
g_debug ("expose for stage: win:0x%x - "
|
||||||
"redrawing area (x: %d, y: %d, width: %d, height: %d)",
|
"redrawing area (x: %d, y: %d, width: %d, height: %d)",
|
||||||
|
@ -1023,11 +1023,11 @@ meta_compositor_real_before_paint (MetaCompositor *compositor,
|
|||||||
meta_compositor_get_instance_private (compositor);
|
meta_compositor_get_instance_private (compositor);
|
||||||
ClutterActor *stage = meta_backend_get_stage (priv->backend);
|
ClutterActor *stage = meta_backend_get_stage (priv->backend);
|
||||||
ClutterStageView *stage_view;
|
ClutterStageView *stage_view;
|
||||||
cairo_rectangle_int_t stage_rect;
|
MtkRectangle stage_rect;
|
||||||
cairo_region_t *unobscured_region;
|
cairo_region_t *unobscured_region;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
stage_rect = (cairo_rectangle_int_t) {
|
stage_rect = (MtkRectangle) {
|
||||||
0, 0,
|
0, 0,
|
||||||
clutter_actor_get_width (stage),
|
clutter_actor_get_width (stage),
|
||||||
clutter_actor_get_height (stage),
|
clutter_actor_get_height (stage),
|
||||||
|
@ -229,7 +229,7 @@ struct _MetaBackgroundContent
|
|||||||
ChangedFlags changed;
|
ChangedFlags changed;
|
||||||
CoglPipeline *pipeline;
|
CoglPipeline *pipeline;
|
||||||
PipelineFlags pipeline_flags;
|
PipelineFlags pipeline_flags;
|
||||||
cairo_rectangle_int_t texture_area;
|
MtkRectangle texture_area;
|
||||||
int texture_width, texture_height;
|
int texture_width, texture_height;
|
||||||
|
|
||||||
cairo_region_t *clip_region;
|
cairo_region_t *clip_region;
|
||||||
@ -389,7 +389,7 @@ static void
|
|||||||
setup_pipeline (MetaBackgroundContent *self,
|
setup_pipeline (MetaBackgroundContent *self,
|
||||||
ClutterActor *actor,
|
ClutterActor *actor,
|
||||||
ClutterPaintContext *paint_context,
|
ClutterPaintContext *paint_context,
|
||||||
cairo_rectangle_int_t *actor_pixel_rect)
|
MtkRectangle *actor_pixel_rect)
|
||||||
{
|
{
|
||||||
MetaContext *context = meta_display_get_context (self->display);
|
MetaContext *context = meta_display_get_context (self->display);
|
||||||
MetaBackend *backend = meta_context_get_backend (context);
|
MetaBackend *backend = meta_context_get_backend (context);
|
||||||
@ -566,7 +566,7 @@ setup_pipeline (MetaBackgroundContent *self,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
set_glsl_parameters (MetaBackgroundContent *self,
|
set_glsl_parameters (MetaBackgroundContent *self,
|
||||||
cairo_rectangle_int_t *actor_pixel_rect)
|
MtkRectangle *actor_pixel_rect)
|
||||||
{
|
{
|
||||||
MetaContext *context = meta_display_get_context (self->display);
|
MetaContext *context = meta_display_get_context (self->display);
|
||||||
MetaBackend *backend = meta_context_get_backend (context);
|
MetaBackend *backend = meta_context_get_backend (context);
|
||||||
@ -616,7 +616,7 @@ static void
|
|||||||
paint_clipped_rectangle (MetaBackgroundContent *self,
|
paint_clipped_rectangle (MetaBackgroundContent *self,
|
||||||
ClutterPaintNode *node,
|
ClutterPaintNode *node,
|
||||||
ClutterActorBox *actor_box,
|
ClutterActorBox *actor_box,
|
||||||
cairo_rectangle_int_t *rect)
|
MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
g_autoptr (ClutterPaintNode) pipeline_node = NULL;
|
g_autoptr (ClutterPaintNode) pipeline_node = NULL;
|
||||||
float h_scale, v_scale;
|
float h_scale, v_scale;
|
||||||
@ -659,8 +659,8 @@ meta_background_content_paint_content (ClutterContent *content,
|
|||||||
{
|
{
|
||||||
MetaBackgroundContent *self = META_BACKGROUND_CONTENT (content);
|
MetaBackgroundContent *self = META_BACKGROUND_CONTENT (content);
|
||||||
ClutterActorBox actor_box;
|
ClutterActorBox actor_box;
|
||||||
cairo_rectangle_int_t rect_within_actor;
|
MtkRectangle rect_within_actor;
|
||||||
cairo_rectangle_int_t rect_within_stage;
|
MtkRectangle rect_within_stage;
|
||||||
cairo_region_t *region;
|
cairo_region_t *region;
|
||||||
int i, n_rects;
|
int i, n_rects;
|
||||||
float transformed_x, transformed_y, transformed_width, transformed_height;
|
float transformed_x, transformed_y, transformed_width, transformed_height;
|
||||||
@ -758,14 +758,14 @@ meta_background_content_paint_content (ClutterContent *content,
|
|||||||
{
|
{
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
cairo_region_get_rectangle (region, i, &rect);
|
cairo_region_get_rectangle (region, i, &rect);
|
||||||
paint_clipped_rectangle (self, node, &actor_box, &rect);
|
paint_clipped_rectangle (self, node, &actor_box, &rect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
cairo_region_get_extents (region, &rect);
|
cairo_region_get_extents (region, &rect);
|
||||||
paint_clipped_rectangle (self, node, &actor_box, &rect);
|
paint_clipped_rectangle (self, node, &actor_box, &rect);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "cogl/cogl.h"
|
#include "cogl/cogl.h"
|
||||||
#include "meta/meta-background.h"
|
#include "meta/meta-background.h"
|
||||||
|
|
||||||
CoglTexture *meta_background_get_texture (MetaBackground *self,
|
CoglTexture * meta_background_get_texture (MetaBackground *self,
|
||||||
int monitor_index,
|
int monitor_index,
|
||||||
cairo_rectangle_int_t *texture_area,
|
MtkRectangle *texture_area,
|
||||||
CoglPipelineWrapMode *wrap_mode);
|
CoglPipelineWrapMode *wrap_mode);
|
||||||
|
@ -369,8 +369,8 @@ meta_background_init (MetaBackground *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_texture_area_from_monitor_area (cairo_rectangle_int_t *monitor_area,
|
set_texture_area_from_monitor_area (MtkRectangle *monitor_area,
|
||||||
cairo_rectangle_int_t *texture_area)
|
MtkRectangle *texture_area)
|
||||||
{
|
{
|
||||||
texture_area->x = 0;
|
texture_area->x = 0;
|
||||||
texture_area->y = 0;
|
texture_area->y = 0;
|
||||||
@ -380,12 +380,12 @@ set_texture_area_from_monitor_area (cairo_rectangle_int_t *monitor_area,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
get_texture_area (MetaBackground *self,
|
get_texture_area (MetaBackground *self,
|
||||||
cairo_rectangle_int_t *monitor_rect,
|
MtkRectangle *monitor_rect,
|
||||||
float monitor_scale,
|
float monitor_scale,
|
||||||
CoglTexture *texture,
|
CoglTexture *texture,
|
||||||
cairo_rectangle_int_t *texture_area)
|
MtkRectangle *texture_area)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t image_area;
|
MtkRectangle image_area;
|
||||||
int screen_width, screen_height;
|
int screen_width, screen_height;
|
||||||
float texture_width, texture_height;
|
float texture_width, texture_height;
|
||||||
float monitor_x_scale, monitor_y_scale;
|
float monitor_x_scale, monitor_y_scale;
|
||||||
@ -493,10 +493,10 @@ draw_texture (MetaBackground *self,
|
|||||||
CoglFramebuffer *framebuffer,
|
CoglFramebuffer *framebuffer,
|
||||||
CoglPipeline *pipeline,
|
CoglPipeline *pipeline,
|
||||||
CoglTexture *texture,
|
CoglTexture *texture,
|
||||||
cairo_rectangle_int_t *monitor_area,
|
MtkRectangle *monitor_area,
|
||||||
float monitor_scale)
|
float monitor_scale)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t texture_area;
|
MtkRectangle texture_area;
|
||||||
gboolean bare_region_visible;
|
gboolean bare_region_visible;
|
||||||
|
|
||||||
get_texture_area (self, monitor_area, monitor_scale, texture, &texture_area);
|
get_texture_area (self, monitor_area, monitor_scale, texture, &texture_area);
|
||||||
@ -531,7 +531,7 @@ draw_texture (MetaBackground *self,
|
|||||||
texture_area.x + texture_area.width,
|
texture_area.x + texture_area.width,
|
||||||
texture_area.y + texture_area.height,
|
texture_area.y + texture_area.height,
|
||||||
0, 0, 1.0, 1.0);
|
0, 0, 1.0, 1.0);
|
||||||
bare_region_visible = texture_has_alpha (texture) || memcmp (&texture_area, monitor_area, sizeof (cairo_rectangle_int_t)) != 0;
|
bare_region_visible = texture_has_alpha (texture) || memcmp (&texture_area, monitor_area, sizeof (MtkRectangle)) != 0;
|
||||||
break;
|
break;
|
||||||
case G_DESKTOP_BACKGROUND_STYLE_NONE:
|
case G_DESKTOP_BACKGROUND_STYLE_NONE:
|
||||||
bare_region_visible = TRUE;
|
bare_region_visible = TRUE;
|
||||||
@ -752,12 +752,12 @@ get_best_mipmap_level (CoglTexture *texture,
|
|||||||
CoglTexture *
|
CoglTexture *
|
||||||
meta_background_get_texture (MetaBackground *self,
|
meta_background_get_texture (MetaBackground *self,
|
||||||
int monitor_index,
|
int monitor_index,
|
||||||
cairo_rectangle_int_t *texture_area,
|
MtkRectangle *texture_area,
|
||||||
CoglPipelineWrapMode *wrap_mode)
|
CoglPipelineWrapMode *wrap_mode)
|
||||||
{
|
{
|
||||||
MetaBackgroundMonitor *monitor;
|
MetaBackgroundMonitor *monitor;
|
||||||
MetaRectangle geometry;
|
MetaRectangle geometry;
|
||||||
cairo_rectangle_int_t monitor_area;
|
MtkRectangle monitor_area;
|
||||||
CoglTexture *texture1, *texture2;
|
CoglTexture *texture1, *texture2;
|
||||||
float monitor_scale;
|
float monitor_scale;
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ meta_shadow_paint (MetaShadow *shadow,
|
|||||||
|
|
||||||
for (j = 0; j < n_y; j++)
|
for (j = 0; j < n_y; j++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t dest_rect;
|
MtkRectangle dest_rect;
|
||||||
dest_rect.y = dest_y[j];
|
dest_rect.y = dest_y[j];
|
||||||
dest_rect.height = dest_y[j + 1] - dest_y[j];
|
dest_rect.height = dest_y[j + 1] - dest_y[j];
|
||||||
|
|
||||||
@ -322,7 +322,7 @@ meta_shadow_paint (MetaShadow *shadow,
|
|||||||
n_rectangles = cairo_region_num_rectangles (intersection);
|
n_rectangles = cairo_region_num_rectangles (intersection);
|
||||||
for (k = 0; k < n_rectangles; k++)
|
for (k = 0; k < n_rectangles; k++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
float src_x1, src_x2, src_y1, src_y2;
|
float src_x1, src_x2, src_y1, src_y2;
|
||||||
|
|
||||||
cairo_region_get_rectangle (intersection, k, &rect);
|
cairo_region_get_rectangle (intersection, k, &rect);
|
||||||
@ -370,7 +370,7 @@ meta_shadow_get_bounds (MetaShadow *shadow,
|
|||||||
int window_y,
|
int window_y,
|
||||||
int window_width,
|
int window_width,
|
||||||
int window_height,
|
int window_height,
|
||||||
cairo_rectangle_int_t *bounds)
|
MtkRectangle *bounds)
|
||||||
{
|
{
|
||||||
bounds->x = window_x - shadow->outer_border_left;
|
bounds->x = window_x - shadow->outer_border_left;
|
||||||
bounds->y = window_y - shadow->outer_border_top;
|
bounds->y = window_y - shadow->outer_border_top;
|
||||||
@ -582,7 +582,7 @@ blur_rows (cairo_region_t *convolve_region,
|
|||||||
n_rectangles = cairo_region_num_rectangles (convolve_region);
|
n_rectangles = cairo_region_num_rectangles (convolve_region);
|
||||||
for (i = 0; i < n_rectangles; i++)
|
for (i = 0; i < n_rectangles; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
cairo_region_get_rectangle (convolve_region, i, &rect);
|
cairo_region_get_rectangle (convolve_region, i, &rect);
|
||||||
|
|
||||||
@ -710,7 +710,7 @@ make_shadow (MetaShadow *shadow,
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
int d = get_box_filter_size (shadow->key.radius);
|
int d = get_box_filter_size (shadow->key.radius);
|
||||||
int spread = get_shadow_spread (shadow->key.radius);
|
int spread = get_shadow_spread (shadow->key.radius);
|
||||||
cairo_rectangle_int_t extents;
|
MtkRectangle extents;
|
||||||
cairo_region_t *row_convolve_region;
|
cairo_region_t *row_convolve_region;
|
||||||
cairo_region_t *column_convolve_region;
|
cairo_region_t *column_convolve_region;
|
||||||
guchar *buffer;
|
guchar *buffer;
|
||||||
@ -763,7 +763,7 @@ make_shadow (MetaShadow *shadow,
|
|||||||
n_rectangles = cairo_region_num_rectangles (region);
|
n_rectangles = cairo_region_num_rectangles (region);
|
||||||
for (k = 0; k < n_rectangles; k++)
|
for (k = 0; k < n_rectangles; k++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
cairo_region_get_rectangle (region, k, &rect);
|
cairo_region_get_rectangle (region, k, &rect);
|
||||||
for (j = y_offset + rect.y; j < y_offset + rect.y + rect.height; j++)
|
for (j = y_offset + rect.y; j < y_offset + rect.y + rect.height; j++)
|
||||||
|
@ -58,7 +58,7 @@ gboolean meta_shaped_texture_update_area (MetaShapedTexture *stex,
|
|||||||
int y,
|
int y,
|
||||||
int width,
|
int width,
|
||||||
int height,
|
int height,
|
||||||
cairo_rectangle_int_t *clip);
|
MtkRectangle *clip);
|
||||||
|
|
||||||
int meta_shaped_texture_get_width (MetaShapedTexture *stex);
|
int meta_shaped_texture_get_width (MetaShapedTexture *stex);
|
||||||
int meta_shaped_texture_get_height (MetaShapedTexture *stex);
|
int meta_shaped_texture_get_height (MetaShapedTexture *stex);
|
||||||
|
@ -528,7 +528,7 @@ static void
|
|||||||
paint_clipped_rectangle_node (MetaShapedTexture *stex,
|
paint_clipped_rectangle_node (MetaShapedTexture *stex,
|
||||||
ClutterPaintNode *root_node,
|
ClutterPaintNode *root_node,
|
||||||
CoglPipeline *pipeline,
|
CoglPipeline *pipeline,
|
||||||
cairo_rectangle_int_t *rect,
|
MtkRectangle *rect,
|
||||||
ClutterActorBox *alloc)
|
ClutterActorBox *alloc)
|
||||||
{
|
{
|
||||||
g_autoptr (ClutterPaintNode) node = NULL;
|
g_autoptr (ClutterPaintNode) node = NULL;
|
||||||
@ -625,7 +625,7 @@ do_paint_content (MetaShapedTexture *stex,
|
|||||||
uint8_t opacity)
|
uint8_t opacity)
|
||||||
{
|
{
|
||||||
int dst_width, dst_height;
|
int dst_width, dst_height;
|
||||||
cairo_rectangle_int_t content_rect;
|
MtkRectangle content_rect;
|
||||||
gboolean use_opaque_region;
|
gboolean use_opaque_region;
|
||||||
cairo_region_t *blended_tex_region;
|
cairo_region_t *blended_tex_region;
|
||||||
CoglContext *ctx;
|
CoglContext *ctx;
|
||||||
@ -645,7 +645,7 @@ do_paint_content (MetaShapedTexture *stex,
|
|||||||
if (dst_width == 0 || dst_height == 0) /* no contents yet */
|
if (dst_width == 0 || dst_height == 0) /* no contents yet */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
content_rect = (cairo_rectangle_int_t) {
|
content_rect = (MtkRectangle) {
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
.width = dst_width,
|
.width = dst_width,
|
||||||
@ -777,7 +777,7 @@ do_paint_content (MetaShapedTexture *stex,
|
|||||||
n_rects = cairo_region_num_rectangles (region);
|
n_rects = cairo_region_num_rectangles (region);
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
cairo_region_get_rectangle (region, i, &rect);
|
cairo_region_get_rectangle (region, i, &rect);
|
||||||
paint_clipped_rectangle_node (stex, root_node,
|
paint_clipped_rectangle_node (stex, root_node,
|
||||||
opaque_pipeline,
|
opaque_pipeline,
|
||||||
@ -844,7 +844,7 @@ do_paint_content (MetaShapedTexture *stex,
|
|||||||
|
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
cairo_region_get_rectangle (blended_tex_region, i, &rect);
|
cairo_region_get_rectangle (blended_tex_region, i, &rect);
|
||||||
|
|
||||||
if (!meta_rectangle_intersect (&content_rect, &rect, &rect))
|
if (!meta_rectangle_intersect (&content_rect, &rect, &rect))
|
||||||
@ -1011,10 +1011,10 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
|
|||||||
int y,
|
int y,
|
||||||
int width,
|
int width,
|
||||||
int height,
|
int height,
|
||||||
cairo_rectangle_int_t *clip)
|
MtkRectangle *clip)
|
||||||
{
|
{
|
||||||
MetaMonitorTransform inverted_transform;
|
MetaMonitorTransform inverted_transform;
|
||||||
cairo_rectangle_int_t buffer_rect;
|
MtkRectangle buffer_rect;
|
||||||
int scaled_and_transformed_width;
|
int scaled_and_transformed_width;
|
||||||
int scaled_and_transformed_height;
|
int scaled_and_transformed_height;
|
||||||
|
|
||||||
@ -1022,14 +1022,14 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Pad the actor clip to ensure that pixels affected by linear scaling are accounted for */
|
/* Pad the actor clip to ensure that pixels affected by linear scaling are accounted for */
|
||||||
*clip = (cairo_rectangle_int_t) {
|
*clip = (MtkRectangle) {
|
||||||
.x = x - 1,
|
.x = x - 1,
|
||||||
.y = y - 1,
|
.y = y - 1,
|
||||||
.width = width + 2,
|
.width = width + 2,
|
||||||
.height = height + 2
|
.height = height + 2
|
||||||
};
|
};
|
||||||
|
|
||||||
buffer_rect = (cairo_rectangle_int_t) {
|
buffer_rect = (MtkRectangle) {
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
.width = stex->tex_width,
|
.width = stex->tex_width,
|
||||||
@ -1236,7 +1236,7 @@ gboolean
|
|||||||
meta_shaped_texture_is_opaque (MetaShapedTexture *stex)
|
meta_shaped_texture_is_opaque (MetaShapedTexture *stex)
|
||||||
{
|
{
|
||||||
MetaMultiTexture *multi_texture;
|
MetaMultiTexture *multi_texture;
|
||||||
cairo_rectangle_int_t opaque_rect;
|
MtkRectangle opaque_rect;
|
||||||
|
|
||||||
multi_texture = stex->texture;
|
multi_texture = stex->texture;
|
||||||
if (!multi_texture)
|
if (!multi_texture)
|
||||||
@ -1417,9 +1417,9 @@ meta_shaped_texture_should_get_via_offscreen (MetaShapedTexture *stex)
|
|||||||
*/
|
*/
|
||||||
cairo_surface_t *
|
cairo_surface_t *
|
||||||
meta_shaped_texture_get_image (MetaShapedTexture *stex,
|
meta_shaped_texture_get_image (MetaShapedTexture *stex,
|
||||||
cairo_rectangle_int_t *clip)
|
MtkRectangle *clip)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t *image_clip = NULL;
|
MtkRectangle *image_clip = NULL;
|
||||||
CoglTexture *texture;
|
CoglTexture *texture;
|
||||||
CoglContext *cogl_context =
|
CoglContext *cogl_context =
|
||||||
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||||
@ -1440,10 +1440,10 @@ meta_shaped_texture_get_image (MetaShapedTexture *stex,
|
|||||||
|
|
||||||
if (clip != NULL)
|
if (clip != NULL)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t dst_rect;
|
MtkRectangle dst_rect;
|
||||||
|
|
||||||
image_clip = alloca (sizeof (cairo_rectangle_int_t));
|
image_clip = alloca (sizeof (MtkRectangle));
|
||||||
dst_rect = (cairo_rectangle_int_t) {
|
dst_rect = (MtkRectangle) {
|
||||||
.width = stex->dst_width,
|
.width = stex->dst_width,
|
||||||
.height = stex->dst_height,
|
.height = stex->dst_height,
|
||||||
};
|
};
|
||||||
|
@ -128,13 +128,13 @@ set_unobscured_region (MetaSurfaceActor *surface_actor,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t bounds = { 0, };
|
MtkRectangle bounds = { 0, };
|
||||||
float width, height;
|
float width, height;
|
||||||
|
|
||||||
clutter_content_get_preferred_size (CLUTTER_CONTENT (priv->texture),
|
clutter_content_get_preferred_size (CLUTTER_CONTENT (priv->texture),
|
||||||
&width,
|
&width,
|
||||||
&height);
|
&height);
|
||||||
bounds = (cairo_rectangle_int_t) {
|
bounds = (MtkRectangle) {
|
||||||
.width = width,
|
.width = width,
|
||||||
.height = height,
|
.height = height,
|
||||||
};
|
};
|
||||||
@ -201,7 +201,7 @@ meta_surface_actor_pick (ClutterActor *actor,
|
|||||||
|
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
ClutterActorBox box;
|
ClutterActorBox box;
|
||||||
|
|
||||||
cairo_region_get_rectangle (priv->input_region, i, &rect);
|
cairo_region_get_rectangle (priv->input_region, i, &rect);
|
||||||
@ -400,7 +400,7 @@ meta_surface_actor_update_area (MetaSurfaceActor *self,
|
|||||||
MetaSurfaceActorPrivate *priv =
|
MetaSurfaceActorPrivate *priv =
|
||||||
meta_surface_actor_get_instance_private (self);
|
meta_surface_actor_get_instance_private (self);
|
||||||
gboolean repaint_scheduled = FALSE;
|
gboolean repaint_scheduled = FALSE;
|
||||||
cairo_rectangle_int_t clip;
|
MtkRectangle clip;
|
||||||
|
|
||||||
if (meta_shaped_texture_update_area (priv->texture, x, y, width, height, &clip))
|
if (meta_shaped_texture_update_area (priv->texture, x, y, width, height, &clip))
|
||||||
{
|
{
|
||||||
@ -425,7 +425,7 @@ meta_surface_actor_update_area (MetaSurfaceActor *self,
|
|||||||
n_rectangles = cairo_region_num_rectangles (intersection);
|
n_rectangles = cairo_region_num_rectangles (intersection);
|
||||||
for (i = 0; i < n_rectangles; i++)
|
for (i = 0; i < n_rectangles; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
cairo_region_get_rectangle (intersection, i, &rect);
|
cairo_region_get_rectangle (intersection, i, &rect);
|
||||||
clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (self), &rect);
|
clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (self), &rect);
|
||||||
@ -483,7 +483,7 @@ meta_surface_actor_is_obscured_on_stage_view (MetaSurfaceActor *self,
|
|||||||
meta_surface_actor_get_instance_private (self);
|
meta_surface_actor_get_instance_private (self);
|
||||||
ClutterActor *stage = clutter_actor_get_stage (CLUTTER_ACTOR (self));
|
ClutterActor *stage = clutter_actor_get_stage (CLUTTER_ACTOR (self));
|
||||||
cairo_region_t *intersection_region;
|
cairo_region_t *intersection_region;
|
||||||
cairo_rectangle_int_t stage_rect;
|
MtkRectangle stage_rect;
|
||||||
graphene_matrix_t transform;
|
graphene_matrix_t transform;
|
||||||
graphene_rect_t actor_bounds;
|
graphene_rect_t actor_bounds;
|
||||||
float bounds_width, bounds_height;
|
float bounds_width, bounds_height;
|
||||||
@ -526,7 +526,7 @@ meta_surface_actor_is_obscured_on_stage_view (MetaSurfaceActor *self,
|
|||||||
n_rects = cairo_region_num_rectangles (intersection_region);
|
n_rects = cairo_region_num_rectangles (intersection_region);
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
cairo_region_get_rectangle (intersection_region, i, &rect);
|
cairo_region_get_rectangle (intersection_region, i, &rect);
|
||||||
intersection_size += rect.width * rect.height;
|
intersection_size += rect.width * rect.height;
|
||||||
@ -600,7 +600,7 @@ meta_surface_actor_process_damage (MetaSurfaceActor *self,
|
|||||||
* any drawing done to the window is always immediately reflected in the
|
* any drawing done to the window is always immediately reflected in the
|
||||||
* texture regardless of damage event handling.
|
* texture regardless of damage event handling.
|
||||||
*/
|
*/
|
||||||
cairo_rectangle_int_t rect = { .x = x, .y = y, .width = width, .height = height };
|
MtkRectangle rect = { .x = x, .y = y, .width = width, .height = height };
|
||||||
|
|
||||||
if (!priv->pending_damage)
|
if (!priv->pending_damage)
|
||||||
priv->pending_damage = cairo_region_create_rectangle (&rect);
|
priv->pending_damage = cairo_region_create_rectangle (&rect);
|
||||||
@ -627,7 +627,7 @@ meta_surface_actor_set_frozen (MetaSurfaceActor *self,
|
|||||||
if (!frozen && priv->pending_damage)
|
if (!frozen && priv->pending_damage)
|
||||||
{
|
{
|
||||||
int i, n_rects = cairo_region_num_rectangles (priv->pending_damage);
|
int i, n_rects = cairo_region_num_rectangles (priv->pending_damage);
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
/* Since we ignore damage events while a window is frozen for certain effects
|
/* Since we ignore damage events while a window is frozen for certain effects
|
||||||
* we need to apply the tracked damage now. */
|
* we need to apply the tracked damage now. */
|
||||||
|
@ -278,10 +278,10 @@ calculate_background_cull_region (MetaWindowActorWayland *self)
|
|||||||
{
|
{
|
||||||
MetaWindowActor *window_actor = META_WINDOW_ACTOR (self);
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (self);
|
||||||
int geometry_scale;
|
int geometry_scale;
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
geometry_scale = meta_window_actor_get_geometry_scale (window_actor);
|
geometry_scale = meta_window_actor_get_geometry_scale (window_actor);
|
||||||
rect = (cairo_rectangle_int_t) {
|
rect = (MtkRectangle) {
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
.width = clutter_actor_get_width (self->background) * geometry_scale,
|
.width = clutter_actor_get_width (self->background) * geometry_scale,
|
||||||
|
@ -521,7 +521,7 @@ get_shadow_params (MetaWindowActorX11 *actor_x11,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
get_shape_bounds (MetaWindowActorX11 *actor_x11,
|
get_shape_bounds (MetaWindowActorX11 *actor_x11,
|
||||||
cairo_rectangle_int_t *bounds)
|
MtkRectangle *bounds)
|
||||||
{
|
{
|
||||||
cairo_region_get_extents (actor_x11->shape_region, bounds);
|
cairo_region_get_extents (actor_x11->shape_region, bounds);
|
||||||
}
|
}
|
||||||
@ -529,10 +529,10 @@ get_shape_bounds (MetaWindowActorX11 *actor_x11,
|
|||||||
static void
|
static void
|
||||||
get_shadow_bounds (MetaWindowActorX11 *actor_x11,
|
get_shadow_bounds (MetaWindowActorX11 *actor_x11,
|
||||||
gboolean appears_focused,
|
gboolean appears_focused,
|
||||||
cairo_rectangle_int_t *bounds)
|
MtkRectangle *bounds)
|
||||||
{
|
{
|
||||||
MetaShadow *shadow;
|
MetaShadow *shadow;
|
||||||
cairo_rectangle_int_t shape_bounds;
|
MtkRectangle shape_bounds;
|
||||||
MetaShadowParams params;
|
MetaShadowParams params;
|
||||||
|
|
||||||
shadow = appears_focused ? actor_x11->focused_shadow
|
shadow = appears_focused ? actor_x11->focused_shadow
|
||||||
@ -662,7 +662,7 @@ check_needs_shadow (MetaWindowActorX11 *actor_x11)
|
|||||||
{
|
{
|
||||||
MetaShadowFactory *factory = actor_x11->shadow_factory;
|
MetaShadowFactory *factory = actor_x11->shadow_factory;
|
||||||
const char *shadow_class = get_shadow_class (actor_x11);
|
const char *shadow_class = get_shadow_class (actor_x11);
|
||||||
cairo_rectangle_int_t shape_bounds;
|
MtkRectangle shape_bounds;
|
||||||
|
|
||||||
if (!actor_x11->shadow_shape)
|
if (!actor_x11->shadow_shape)
|
||||||
{
|
{
|
||||||
@ -712,7 +712,7 @@ scan_visible_region (guchar *mask_data,
|
|||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
cairo_region_get_rectangle (scan_area, i, &rect);
|
cairo_region_get_rectangle (scan_area, i, &rect);
|
||||||
|
|
||||||
@ -739,11 +739,11 @@ scan_visible_region (guchar *mask_data,
|
|||||||
static void
|
static void
|
||||||
get_client_area_rect_from_texture (MetaWindowActorX11 *actor_x11,
|
get_client_area_rect_from_texture (MetaWindowActorX11 *actor_x11,
|
||||||
MetaShapedTexture *shaped_texture,
|
MetaShapedTexture *shaped_texture,
|
||||||
cairo_rectangle_int_t *client_area)
|
MtkRectangle *client_area)
|
||||||
{
|
{
|
||||||
MetaWindow *window =
|
MetaWindow *window =
|
||||||
meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11));
|
meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11));
|
||||||
cairo_rectangle_int_t surface_rect = { 0 };
|
MtkRectangle surface_rect = { 0 };
|
||||||
|
|
||||||
surface_rect.width = meta_shaped_texture_get_width (shaped_texture);
|
surface_rect.width = meta_shaped_texture_get_width (shaped_texture);
|
||||||
surface_rect.height = meta_shaped_texture_get_height (shaped_texture);
|
surface_rect.height = meta_shaped_texture_get_height (shaped_texture);
|
||||||
@ -754,7 +754,7 @@ get_client_area_rect_from_texture (MetaWindowActorX11 *actor_x11,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
get_client_area_rect (MetaWindowActorX11 *actor_x11,
|
get_client_area_rect (MetaWindowActorX11 *actor_x11,
|
||||||
cairo_rectangle_int_t *client_area)
|
MtkRectangle *client_area)
|
||||||
{
|
{
|
||||||
MetaSurfaceActor *surface =
|
MetaSurfaceActor *surface =
|
||||||
meta_window_actor_get_surface (META_WINDOW_ACTOR (actor_x11));
|
meta_window_actor_get_surface (META_WINDOW_ACTOR (actor_x11));
|
||||||
@ -816,9 +816,9 @@ build_and_scan_frame_mask (MetaWindowActorX11 *actor_x11,
|
|||||||
if (window->frame)
|
if (window->frame)
|
||||||
{
|
{
|
||||||
cairo_region_t *frame_paint_region, *scanned_region;
|
cairo_region_t *frame_paint_region, *scanned_region;
|
||||||
cairo_rectangle_int_t rect = { 0, 0, tex_width, tex_height };
|
MtkRectangle rect = { 0, 0, tex_width, tex_height };
|
||||||
cairo_rectangle_int_t client_area;
|
MtkRectangle client_area;
|
||||||
cairo_rectangle_int_t frame_rect;
|
MtkRectangle frame_rect;
|
||||||
|
|
||||||
/* If we update the shape regardless of the frozen state of the actor,
|
/* If we update the shape regardless of the frozen state of the actor,
|
||||||
* as with Xwayland to avoid the black shadow effect, we ought to base
|
* as with Xwayland to avoid the black shadow effect, we ought to base
|
||||||
@ -898,7 +898,7 @@ update_shape_region (MetaWindowActorX11 *actor_x11)
|
|||||||
MetaWindow *window =
|
MetaWindow *window =
|
||||||
meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11));
|
meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11));
|
||||||
cairo_region_t *region = NULL;
|
cairo_region_t *region = NULL;
|
||||||
cairo_rectangle_int_t client_area;
|
MtkRectangle client_area;
|
||||||
|
|
||||||
get_client_area_rect (actor_x11, &client_area);
|
get_client_area_rect (actor_x11, &client_area);
|
||||||
|
|
||||||
@ -941,7 +941,7 @@ update_input_region (MetaWindowActorX11 *actor_x11)
|
|||||||
|
|
||||||
if (window->shape_region && window->input_region)
|
if (window->shape_region && window->input_region)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t client_area;
|
MtkRectangle client_area;
|
||||||
cairo_region_t *frames_input;
|
cairo_region_t *frames_input;
|
||||||
cairo_region_t *client_input;
|
cairo_region_t *client_input;
|
||||||
|
|
||||||
@ -960,7 +960,7 @@ update_input_region (MetaWindowActorX11 *actor_x11)
|
|||||||
}
|
}
|
||||||
else if (window->shape_region)
|
else if (window->shape_region)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t client_area;
|
MtkRectangle client_area;
|
||||||
|
|
||||||
meta_window_get_client_area_rect (window, &client_area);
|
meta_window_get_client_area_rect (window, &client_area);
|
||||||
|
|
||||||
@ -1015,7 +1015,7 @@ update_opaque_region (MetaWindowActorX11 *actor_x11)
|
|||||||
(window->opaque_region ||
|
(window->opaque_region ||
|
||||||
(window->frame && window->frame->opaque_region)))
|
(window->frame && window->frame->opaque_region)))
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t client_area;
|
MtkRectangle client_area;
|
||||||
|
|
||||||
if (window->frame && window->frame->opaque_region)
|
if (window->frame && window->frame->opaque_region)
|
||||||
opaque_region = cairo_region_copy (window->frame->opaque_region);
|
opaque_region = cairo_region_copy (window->frame->opaque_region);
|
||||||
@ -1212,7 +1212,7 @@ meta_window_actor_x11_paint (ClutterActor *actor,
|
|||||||
if (shadow)
|
if (shadow)
|
||||||
{
|
{
|
||||||
MetaShadowParams params;
|
MetaShadowParams params;
|
||||||
cairo_rectangle_int_t shape_bounds;
|
MtkRectangle shape_bounds;
|
||||||
cairo_region_t *clip = actor_x11->shadow_clip;
|
cairo_region_t *clip = actor_x11->shadow_clip;
|
||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
|
|
||||||
@ -1224,7 +1224,7 @@ meta_window_actor_x11_paint (ClutterActor *actor,
|
|||||||
*/
|
*/
|
||||||
if (!clip && clip_shadow_under_window (actor_x11))
|
if (!clip && clip_shadow_under_window (actor_x11))
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t bounds;
|
MtkRectangle bounds;
|
||||||
|
|
||||||
get_shadow_bounds (actor_x11, appears_focused, &bounds);
|
get_shadow_bounds (actor_x11, appears_focused, &bounds);
|
||||||
clip = cairo_region_create_rectangle (&bounds);
|
clip = cairo_region_create_rectangle (&bounds);
|
||||||
@ -1321,7 +1321,7 @@ meta_window_actor_x11_get_paint_volume (ClutterActor *actor,
|
|||||||
appears_focused = meta_window_appears_focused (window);
|
appears_focused = meta_window_appears_focused (window);
|
||||||
if (appears_focused ? actor_x11->focused_shadow : actor_x11->unfocused_shadow)
|
if (appears_focused ? actor_x11->focused_shadow : actor_x11->unfocused_shadow)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t shadow_bounds;
|
MtkRectangle shadow_bounds;
|
||||||
ClutterActorBox shadow_box;
|
ClutterActorBox shadow_box;
|
||||||
|
|
||||||
/* We could compute an full clip region as we do for the window
|
/* We could compute an full clip region as we do for the window
|
||||||
|
@ -35,7 +35,7 @@ struct _MetaWindowShape
|
|||||||
|
|
||||||
int top, right, bottom, left;
|
int top, right, bottom, left;
|
||||||
int n_rectangles;
|
int n_rectangles;
|
||||||
cairo_rectangle_int_t *rectangles;
|
MtkRectangle *rectangles;
|
||||||
guint hash;
|
guint hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ meta_window_shape_new (cairo_region_t *region)
|
|||||||
{
|
{
|
||||||
MetaWindowShape *shape;
|
MetaWindowShape *shape;
|
||||||
MetaRegionIterator iter;
|
MetaRegionIterator iter;
|
||||||
cairo_rectangle_int_t extents;
|
MtkRectangle extents;
|
||||||
int max_yspan_y1 = 0;
|
int max_yspan_y1 = 0;
|
||||||
int max_yspan_y2 = 0;
|
int max_yspan_y2 = 0;
|
||||||
int max_xspan_x1 = -1;
|
int max_xspan_x1 = -1;
|
||||||
@ -114,7 +114,7 @@ meta_window_shape_new (cairo_region_t *region)
|
|||||||
shape->bottom = extents.y + extents.height - max_yspan_y2;
|
shape->bottom = extents.y + extents.height - max_yspan_y2;
|
||||||
shape->left = max_xspan_x1 - extents.x;
|
shape->left = max_xspan_x1 - extents.x;
|
||||||
|
|
||||||
shape->rectangles = g_new (cairo_rectangle_int_t, shape->n_rectangles);
|
shape->rectangles = g_new (MtkRectangle, shape->n_rectangles);
|
||||||
|
|
||||||
hash = 0;
|
hash = 0;
|
||||||
for (meta_region_iterator_init (&iter, region);
|
for (meta_region_iterator_init (&iter, region);
|
||||||
@ -194,7 +194,7 @@ meta_window_shape_equal (MetaWindowShape *shape_a,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return memcmp (shape_a->rectangles, shape_b->rectangles,
|
return memcmp (shape_a->rectangles, shape_b->rectangles,
|
||||||
sizeof (cairo_rectangle_int_t) * shape_a->n_rectangles) == 0;
|
sizeof (MtkRectangle) * shape_a->n_rectangles) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -237,7 +237,7 @@ meta_window_shape_to_region (MetaWindowShape *shape,
|
|||||||
|
|
||||||
for (i = 0; i < shape->n_rectangles; i++)
|
for (i = 0; i < shape->n_rectangles; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect = shape->rectangles[i];
|
MtkRectangle rect = shape->rectangles[i];
|
||||||
|
|
||||||
if (rect.x <= shape->left && rect.x + rect.width >= shape->left + 1)
|
if (rect.x <= shape->left && rect.x + rect.width >= shape->left + 1)
|
||||||
rect.width += center_width;
|
rect.width += center_width;
|
||||||
|
@ -29,11 +29,11 @@
|
|||||||
#define META_REGION_MAX_STACK_RECTS 256
|
#define META_REGION_MAX_STACK_RECTS 256
|
||||||
|
|
||||||
#define META_REGION_CREATE_RECTANGLE_ARRAY_SCOPED(n_rects, rects) \
|
#define META_REGION_CREATE_RECTANGLE_ARRAY_SCOPED(n_rects, rects) \
|
||||||
g_autofree cairo_rectangle_int_t *G_PASTE(__n, __LINE__) = NULL; \
|
g_autofree MtkRectangle *G_PASTE(__n, __LINE__) = NULL; \
|
||||||
if (n_rects < META_REGION_MAX_STACK_RECTS) \
|
if (n_rects < META_REGION_MAX_STACK_RECTS) \
|
||||||
rects = g_newa (cairo_rectangle_int_t, n_rects); \
|
rects = g_newa (MtkRectangle, n_rects); \
|
||||||
else \
|
else \
|
||||||
rects = G_PASTE(__n, __LINE__) = g_new (cairo_rectangle_int_t, n_rects);
|
rects = G_PASTE(__n, __LINE__) = g_new (MtkRectangle, n_rects);
|
||||||
|
|
||||||
/* MetaRegionBuilder */
|
/* MetaRegionBuilder */
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ meta_region_builder_add_rectangle (MetaRegionBuilder *builder,
|
|||||||
int width,
|
int width,
|
||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (builder->levels[0] == NULL)
|
if (builder->levels[0] == NULL)
|
||||||
@ -189,7 +189,7 @@ cairo_region_t *
|
|||||||
meta_region_scale (cairo_region_t *region, int scale)
|
meta_region_scale (cairo_region_t *region, int scale)
|
||||||
{
|
{
|
||||||
int n_rects, i;
|
int n_rects, i;
|
||||||
cairo_rectangle_int_t *rects;
|
MtkRectangle *rects;
|
||||||
cairo_region_t *scaled_region;
|
cairo_region_t *scaled_region;
|
||||||
|
|
||||||
if (scale == 1)
|
if (scale == 1)
|
||||||
@ -246,7 +246,7 @@ expand_region (cairo_region_t *region,
|
|||||||
n = cairo_region_num_rectangles (region);
|
n = cairo_region_num_rectangles (region);
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
cairo_region_get_rectangle (region, i, &rect);
|
cairo_region_get_rectangle (region, i, &rect);
|
||||||
add_expanded_rect (&builder,
|
add_expanded_rect (&builder,
|
||||||
@ -267,7 +267,7 @@ expand_region_inverse (cairo_region_t *region,
|
|||||||
{
|
{
|
||||||
MetaRegionBuilder builder;
|
MetaRegionBuilder builder;
|
||||||
MetaRegionIterator iter;
|
MetaRegionIterator iter;
|
||||||
cairo_rectangle_int_t extents;
|
MtkRectangle extents;
|
||||||
|
|
||||||
int last_x;
|
int last_x;
|
||||||
|
|
||||||
@ -356,7 +356,7 @@ meta_region_transform (const cairo_region_t *region,
|
|||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
int n_rects, i;
|
int n_rects, i;
|
||||||
cairo_rectangle_int_t *rects;
|
MtkRectangle *rects;
|
||||||
cairo_region_t *transformed_region;
|
cairo_region_t *transformed_region;
|
||||||
|
|
||||||
if (transform == META_MONITOR_TRANSFORM_NORMAL)
|
if (transform == META_MONITOR_TRANSFORM_NORMAL)
|
||||||
@ -387,7 +387,7 @@ meta_region_crop_and_scale (cairo_region_t *region,
|
|||||||
int dst_height)
|
int dst_height)
|
||||||
{
|
{
|
||||||
int n_rects, i;
|
int n_rects, i;
|
||||||
cairo_rectangle_int_t *rects;
|
MtkRectangle *rects;
|
||||||
cairo_region_t *viewport_region;
|
cairo_region_t *viewport_region;
|
||||||
|
|
||||||
if (G_APPROX_VALUE (src_rect->size.width, dst_width, FLT_EPSILON) &&
|
if (G_APPROX_VALUE (src_rect->size.width, dst_width, FLT_EPSILON) &&
|
||||||
@ -432,7 +432,7 @@ void
|
|||||||
meta_region_to_cairo_path (cairo_region_t *region,
|
meta_region_to_cairo_path (cairo_region_t *region,
|
||||||
cairo_t *cr)
|
cairo_t *cr)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
int n_rects, i;
|
int n_rects, i;
|
||||||
|
|
||||||
n_rects = cairo_region_num_rectangles (region);
|
n_rects = cairo_region_num_rectangles (region);
|
||||||
@ -449,7 +449,7 @@ meta_region_apply_matrix_transform_expand (const cairo_region_t *region,
|
|||||||
graphene_matrix_t *transform)
|
graphene_matrix_t *transform)
|
||||||
{
|
{
|
||||||
int n_rects, i;
|
int n_rects, i;
|
||||||
cairo_rectangle_int_t *rects;
|
MtkRectangle *rects;
|
||||||
cairo_region_t *transformed_region;
|
cairo_region_t *transformed_region;
|
||||||
|
|
||||||
if (graphene_matrix_is_identity (transform))
|
if (graphene_matrix_is_identity (transform))
|
||||||
@ -460,7 +460,7 @@ meta_region_apply_matrix_transform_expand (const cairo_region_t *region,
|
|||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
graphene_rect_t transformed_rect, rect;
|
graphene_rect_t transformed_rect, rect;
|
||||||
cairo_rectangle_int_t int_rect;
|
MtkRectangle int_rect;
|
||||||
|
|
||||||
cairo_region_get_rectangle (region, i, &int_rect);
|
cairo_region_get_rectangle (region, i, &int_rect);
|
||||||
rect = meta_rectangle_to_graphene_rect (&int_rect);
|
rect = meta_rectangle_to_graphene_rect (&int_rect);
|
||||||
|
@ -52,14 +52,14 @@ typedef struct _MetaRegionIterator MetaRegionIterator;
|
|||||||
|
|
||||||
struct _MetaRegionIterator {
|
struct _MetaRegionIterator {
|
||||||
cairo_region_t *region;
|
cairo_region_t *region;
|
||||||
cairo_rectangle_int_t rectangle;
|
MtkRectangle rectangle;
|
||||||
gboolean line_start;
|
gboolean line_start;
|
||||||
gboolean line_end;
|
gboolean line_end;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
int n_rectangles;
|
int n_rectangles;
|
||||||
cairo_rectangle_int_t next_rectangle;
|
MtkRectangle next_rectangle;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _MetaRegionBuilder MetaRegionBuilder;
|
typedef struct _MetaRegionBuilder MetaRegionBuilder;
|
||||||
|
@ -407,7 +407,7 @@ meta_frame_get_frame_bounds (MetaFrame *frame)
|
|||||||
/* FIXME: currently just the client area, should shape closer to
|
/* FIXME: currently just the client area, should shape closer to
|
||||||
* frame border, incl. rounded corners.
|
* frame border, incl. rounded corners.
|
||||||
*/
|
*/
|
||||||
bounds = cairo_region_create_rectangle (&(cairo_rectangle_int_t) {
|
bounds = cairo_region_create_rectangle (&(MtkRectangle) {
|
||||||
borders.total.left,
|
borders.total.left,
|
||||||
borders.total.top,
|
borders.total.top,
|
||||||
frame->rect.width - borders.total.left - borders.total.right,
|
frame->rect.width - borders.total.left - borders.total.right,
|
||||||
@ -419,7 +419,7 @@ meta_frame_get_frame_bounds (MetaFrame *frame)
|
|||||||
|
|
||||||
void
|
void
|
||||||
meta_frame_get_mask (MetaFrame *frame,
|
meta_frame_get_mask (MetaFrame *frame,
|
||||||
cairo_rectangle_int_t *frame_rect,
|
MtkRectangle *frame_rect,
|
||||||
cairo_t *cr)
|
cairo_t *cr)
|
||||||
{
|
{
|
||||||
MetaFrameBorders borders;
|
MetaFrameBorders borders;
|
||||||
|
@ -70,7 +70,7 @@ void meta_frame_clear_cached_borders (MetaFrame *frame);
|
|||||||
cairo_region_t *meta_frame_get_frame_bounds (MetaFrame *frame);
|
cairo_region_t *meta_frame_get_frame_bounds (MetaFrame *frame);
|
||||||
|
|
||||||
void meta_frame_get_mask (MetaFrame *frame,
|
void meta_frame_get_mask (MetaFrame *frame,
|
||||||
cairo_rectangle_int_t *frame_rect,
|
MtkRectangle *frame_rect,
|
||||||
cairo_t *cr);
|
cairo_t *cr);
|
||||||
|
|
||||||
gboolean meta_frame_handle_xevent (MetaFrame *frame,
|
gboolean meta_frame_handle_xevent (MetaFrame *frame,
|
||||||
|
@ -2565,7 +2565,7 @@ handle_activate_window_menu (MetaDisplay *display,
|
|||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
MetaRectangle frame_rect;
|
MetaRectangle frame_rect;
|
||||||
cairo_rectangle_int_t child_rect;
|
MtkRectangle child_rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (display->focus_window, &frame_rect);
|
meta_window_get_frame_rect (display->focus_window, &frame_rect);
|
||||||
meta_window_get_client_area_rect (display->focus_window, &child_rect);
|
meta_window_get_client_area_rect (display->focus_window, &child_rect);
|
||||||
|
@ -816,7 +816,7 @@ void meta_window_handle_ungrabbed_event (MetaWindow *window,
|
|||||||
const ClutterEvent *event);
|
const ClutterEvent *event);
|
||||||
|
|
||||||
void meta_window_get_client_area_rect (const MetaWindow *window,
|
void meta_window_get_client_area_rect (const MetaWindow *window,
|
||||||
cairo_rectangle_int_t *rect);
|
MtkRectangle *rect);
|
||||||
void meta_window_get_titlebar_rect (MetaWindow *window,
|
void meta_window_get_titlebar_rect (MetaWindow *window,
|
||||||
MetaRectangle *titlebar_rect);
|
MetaRectangle *titlebar_rect);
|
||||||
|
|
||||||
|
@ -4453,7 +4453,7 @@ meta_window_get_frame_rect (const MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_window_get_client_area_rect (const MetaWindow *window,
|
meta_window_get_client_area_rect (const MetaWindow *window,
|
||||||
cairo_rectangle_int_t *rect)
|
MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
MetaFrameBorders borders;
|
MetaFrameBorders borders;
|
||||||
|
|
||||||
|
@ -1268,6 +1268,7 @@ if have_introspection
|
|||||||
libmutter_cogl_gir[0],
|
libmutter_cogl_gir[0],
|
||||||
libmutter_cogl_pango_gir[0],
|
libmutter_cogl_pango_gir[0],
|
||||||
libmutter_clutter_gir[0],
|
libmutter_clutter_gir[0],
|
||||||
|
libmutter_mtk_gir[0],
|
||||||
],
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
libmutter_dep,
|
libmutter_dep,
|
||||||
|
@ -121,7 +121,7 @@ void meta_shadow_get_bounds (MetaShadow *shadow,
|
|||||||
int window_y,
|
int window_y,
|
||||||
int window_width,
|
int window_width,
|
||||||
int window_height,
|
int window_height,
|
||||||
cairo_rectangle_int_t *bounds);
|
MtkRectangle *bounds);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
MetaShadowFactory *meta_shadow_factory_new (void);
|
MetaShadowFactory *meta_shadow_factory_new (void);
|
||||||
|
@ -53,6 +53,6 @@ void meta_shaped_texture_set_mask_texture (MetaShapedTexture *stex,
|
|||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
cairo_surface_t * meta_shaped_texture_get_image (MetaShapedTexture *stex,
|
cairo_surface_t * meta_shaped_texture_get_image (MetaShapedTexture *stex,
|
||||||
cairo_rectangle_int_t *clip);
|
MtkRectangle *clip);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
@ -48,7 +48,7 @@ gboolean meta_window_actor_is_destroyed (MetaWindowActor *self);
|
|||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
cairo_surface_t * meta_window_actor_get_image (MetaWindowActor *self,
|
cairo_surface_t * meta_window_actor_get_image (MetaWindowActor *self,
|
||||||
cairo_rectangle_int_t *clip);
|
MtkRectangle *clip);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
ClutterContent * meta_window_actor_paint_to_content (MetaWindowActor *self,
|
ClutterContent * meta_window_actor_paint_to_content (MetaWindowActor *self,
|
||||||
|
@ -572,7 +572,7 @@ meta_check_monitor_configuration (MetaContext *context,
|
|||||||
const GList *outputs = meta_crtc_get_outputs (crtc);
|
const GList *outputs = meta_crtc_get_outputs (crtc);
|
||||||
const GList *l_output;
|
const GList *l_output;
|
||||||
MetaRendererView *view;
|
MetaRendererView *view;
|
||||||
cairo_rectangle_int_t view_layout;
|
MtkRectangle view_layout;
|
||||||
|
|
||||||
for (l_output = outputs;
|
for (l_output = outputs;
|
||||||
l_output;
|
l_output;
|
||||||
|
@ -229,7 +229,7 @@ capture_view_into (ClutterStageView *view,
|
|||||||
ClutterBackend *backend;
|
ClutterBackend *backend;
|
||||||
CoglContext *context;
|
CoglContext *context;
|
||||||
CoglBitmap *bitmap;
|
CoglBitmap *bitmap;
|
||||||
cairo_rectangle_int_t view_layout;
|
MtkRectangle view_layout;
|
||||||
float view_scale;
|
float view_scale;
|
||||||
float texture_width;
|
float texture_width;
|
||||||
float texture_height;
|
float texture_height;
|
||||||
|
@ -505,7 +505,7 @@ assert_is_stage_view (ClutterStageView *stage_view,
|
|||||||
int width,
|
int width,
|
||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t layout;
|
MtkRectangle layout;
|
||||||
|
|
||||||
g_assert_nonnull (stage_view);
|
g_assert_nonnull (stage_view);
|
||||||
g_assert_true (CLUTTER_IS_STAGE_VIEW (stage_view));
|
g_assert_true (CLUTTER_IS_STAGE_VIEW (stage_view));
|
||||||
|
@ -61,7 +61,7 @@ meta_pointer_lock_wayland_create_constraint (MetaPointerConfinementWayland *conf
|
|||||||
ClutterInputDevice *pointer = clutter_seat_get_pointer (seat);
|
ClutterInputDevice *pointer = clutter_seat_get_pointer (seat);
|
||||||
MetaPointerConstraint *constraint;
|
MetaPointerConstraint *constraint;
|
||||||
graphene_point_t point;
|
graphene_point_t point;
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
cairo_region_t *region;
|
cairo_region_t *region;
|
||||||
float sx, sy, x, y;
|
float sx, sy, x, y;
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ meta_pointer_lock_wayland_create_constraint (MetaPointerConfinementWayland *conf
|
|||||||
&sx, &sy);
|
&sx, &sy);
|
||||||
|
|
||||||
meta_wayland_surface_get_absolute_coordinates (surface, sx, sy, &x, &y);
|
meta_wayland_surface_get_absolute_coordinates (surface, sx, sy, &x, &y);
|
||||||
rect = (cairo_rectangle_int_t) { .x = x, .y = y, .width = 1, .height = 1 };
|
rect = (MtkRectangle) { .x = x, .y = y, .width = 1, .height = 1 };
|
||||||
region = cairo_region_create_rectangle (&rect);
|
region = cairo_region_create_rectangle (&rect);
|
||||||
|
|
||||||
constraint = meta_pointer_constraint_new (region, 0.0);
|
constraint = meta_pointer_constraint_new (region, 0.0);
|
||||||
|
@ -179,7 +179,7 @@ meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor
|
|||||||
MetaSurfaceActor *surface_actor;
|
MetaSurfaceActor *surface_actor;
|
||||||
MetaShapedTexture *stex;
|
MetaShapedTexture *stex;
|
||||||
MetaWaylandBuffer *buffer;
|
MetaWaylandBuffer *buffer;
|
||||||
cairo_rectangle_int_t surface_rect;
|
MtkRectangle surface_rect;
|
||||||
MetaWaylandSurface *subsurface_surface;
|
MetaWaylandSurface *subsurface_surface;
|
||||||
|
|
||||||
surface_actor = priv->actor;
|
surface_actor = priv->actor;
|
||||||
@ -207,7 +207,7 @@ meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor
|
|||||||
meta_shaped_texture_set_texture (stex, NULL);
|
meta_shaped_texture_set_texture (stex, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
surface_rect = (cairo_rectangle_int_t) {
|
surface_rect = (MtkRectangle) {
|
||||||
.width = meta_wayland_surface_get_width (surface),
|
.width = meta_wayland_surface_get_width (surface),
|
||||||
.height = meta_wayland_surface_get_height (surface),
|
.height = meta_wayland_surface_get_height (surface),
|
||||||
};
|
};
|
||||||
|
@ -701,7 +701,7 @@ process_shm_buffer_damage (MetaWaylandBuffer *buffer,
|
|||||||
{
|
{
|
||||||
const uint8_t *data = wl_shm_buffer_get_data (shm_buffer);
|
const uint8_t *data = wl_shm_buffer_get_data (shm_buffer);
|
||||||
int32_t stride = wl_shm_buffer_get_stride (shm_buffer);
|
int32_t stride = wl_shm_buffer_get_stride (shm_buffer);
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
int bpp;
|
int bpp;
|
||||||
|
|
||||||
bpp = cogl_pixel_format_get_bytes_per_pixel (format, 0);
|
bpp = cogl_pixel_format_get_bytes_per_pixel (format, 0);
|
||||||
|
@ -630,7 +630,7 @@ meta_wayland_pointer_constraint_calculate_effective_region (MetaWaylandPointerCo
|
|||||||
frame->bottom_height);
|
frame->bottom_height);
|
||||||
if (actual_width > 0 && actual_height > 0)
|
if (actual_width > 0 && actual_height > 0)
|
||||||
{
|
{
|
||||||
cairo_region_intersect_rectangle (region, &(cairo_rectangle_int_t) {
|
cairo_region_intersect_rectangle (region, &(MtkRectangle) {
|
||||||
.x = frame->child_x,
|
.x = frame->child_x,
|
||||||
.y = frame->child_y,
|
.y = frame->child_y,
|
||||||
.width = actual_width,
|
.width = actual_width,
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "mtk/mtk.h"
|
||||||
#include "wayland/meta-wayland-region.h"
|
#include "wayland/meta-wayland-region.h"
|
||||||
|
|
||||||
struct _MetaWaylandRegion
|
struct _MetaWaylandRegion
|
||||||
@ -46,7 +47,7 @@ wl_region_add (struct wl_client *client,
|
|||||||
gint32 height)
|
gint32 height)
|
||||||
{
|
{
|
||||||
MetaWaylandRegion *region = wl_resource_get_user_data (resource);
|
MetaWaylandRegion *region = wl_resource_get_user_data (resource);
|
||||||
cairo_rectangle_int_t rectangle = { x, y, width, height };
|
MtkRectangle rectangle = { x, y, width, height };
|
||||||
|
|
||||||
cairo_region_union_rectangle (region->region, &rectangle);
|
cairo_region_union_rectangle (region->region, &rectangle);
|
||||||
}
|
}
|
||||||
@ -60,7 +61,7 @@ wl_region_subtract (struct wl_client *client,
|
|||||||
gint32 height)
|
gint32 height)
|
||||||
{
|
{
|
||||||
MetaWaylandRegion *region = wl_resource_get_user_data (resource);
|
MetaWaylandRegion *region = wl_resource_get_user_data (resource);
|
||||||
cairo_rectangle_int_t rectangle = { x, y, width, height };
|
MtkRectangle rectangle = { x, y, width, height };
|
||||||
|
|
||||||
cairo_region_subtract_rectangle (region->region, &rectangle);
|
cairo_region_subtract_rectangle (region->region, &rectangle);
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,7 @@ surface_process_damage (MetaWaylandSurface *surface,
|
|||||||
cairo_region_t *buffer_region)
|
cairo_region_t *buffer_region)
|
||||||
{
|
{
|
||||||
MetaWaylandBuffer *buffer = meta_wayland_surface_get_buffer (surface);
|
MetaWaylandBuffer *buffer = meta_wayland_surface_get_buffer (surface);
|
||||||
cairo_rectangle_int_t buffer_rect;
|
MtkRectangle buffer_rect;
|
||||||
MetaSurfaceActor *actor;
|
MetaSurfaceActor *actor;
|
||||||
|
|
||||||
/* If the client destroyed the buffer it attached before committing, but
|
/* If the client destroyed the buffer it attached before committing, but
|
||||||
@ -276,14 +276,14 @@ surface_process_damage (MetaWaylandSurface *surface,
|
|||||||
if (!buffer)
|
if (!buffer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
buffer_rect = (cairo_rectangle_int_t) {
|
buffer_rect = (MtkRectangle) {
|
||||||
.width = meta_wayland_surface_get_buffer_width (surface),
|
.width = meta_wayland_surface_get_buffer_width (surface),
|
||||||
.height = meta_wayland_surface_get_buffer_height (surface),
|
.height = meta_wayland_surface_get_buffer_height (surface),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!cairo_region_is_empty (surface_region))
|
if (!cairo_region_is_empty (surface_region))
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t surface_rect;
|
MtkRectangle surface_rect;
|
||||||
cairo_region_t *scaled_region;
|
cairo_region_t *scaled_region;
|
||||||
cairo_region_t *transformed_region;
|
cairo_region_t *transformed_region;
|
||||||
cairo_region_t *viewport_region;
|
cairo_region_t *viewport_region;
|
||||||
@ -292,7 +292,7 @@ surface_process_damage (MetaWaylandSurface *surface,
|
|||||||
/* Intersect the damage region with the surface region before scaling in
|
/* Intersect the damage region with the surface region before scaling in
|
||||||
* order to avoid integer overflow when scaling a damage region is too
|
* order to avoid integer overflow when scaling a damage region is too
|
||||||
* large (for example INT32_MAX which mesa passes). */
|
* large (for example INT32_MAX which mesa passes). */
|
||||||
surface_rect = (cairo_rectangle_int_t) {
|
surface_rect = (MtkRectangle) {
|
||||||
.width = meta_wayland_surface_get_width (surface),
|
.width = meta_wayland_surface_get_width (surface),
|
||||||
.height = meta_wayland_surface_get_height (surface),
|
.height = meta_wayland_surface_get_height (surface),
|
||||||
};
|
};
|
||||||
@ -362,7 +362,7 @@ surface_process_damage (MetaWaylandSurface *surface,
|
|||||||
n_rectangles = cairo_region_num_rectangles (buffer_region);
|
n_rectangles = cairo_region_num_rectangles (buffer_region);
|
||||||
for (i = 0; i < n_rectangles; i++)
|
for (i = 0; i < n_rectangles; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
cairo_region_get_rectangle (buffer_region, i, &rect);
|
cairo_region_get_rectangle (buffer_region, i, &rect);
|
||||||
|
|
||||||
meta_surface_actor_process_damage (actor,
|
meta_surface_actor_process_damage (actor,
|
||||||
@ -1063,9 +1063,9 @@ wl_surface_damage (struct wl_client *client,
|
|||||||
{
|
{
|
||||||
MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
|
MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
|
||||||
MetaWaylandSurfaceState *pending = surface->pending_state;
|
MetaWaylandSurfaceState *pending = surface->pending_state;
|
||||||
cairo_rectangle_int_t rectangle;
|
MtkRectangle rectangle;
|
||||||
|
|
||||||
rectangle = (cairo_rectangle_int_t) {
|
rectangle = (MtkRectangle) {
|
||||||
.x = x,
|
.x = x,
|
||||||
.y = y,
|
.y = y,
|
||||||
.width = width,
|
.width = width,
|
||||||
@ -1232,9 +1232,9 @@ wl_surface_damage_buffer (struct wl_client *client,
|
|||||||
{
|
{
|
||||||
MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
|
MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
|
||||||
MetaWaylandSurfaceState *pending = surface->pending_state;
|
MetaWaylandSurfaceState *pending = surface->pending_state;
|
||||||
cairo_rectangle_int_t rectangle;
|
MtkRectangle rectangle;
|
||||||
|
|
||||||
rectangle = (cairo_rectangle_int_t) {
|
rectangle = (MtkRectangle) {
|
||||||
.x = x,
|
.x = x,
|
||||||
.y = y,
|
.y = y,
|
||||||
.width = width,
|
.width = width,
|
||||||
@ -2070,12 +2070,12 @@ cairo_region_t *
|
|||||||
meta_wayland_surface_calculate_input_region (MetaWaylandSurface *surface)
|
meta_wayland_surface_calculate_input_region (MetaWaylandSurface *surface)
|
||||||
{
|
{
|
||||||
cairo_region_t *region;
|
cairo_region_t *region;
|
||||||
cairo_rectangle_int_t buffer_rect;
|
MtkRectangle buffer_rect;
|
||||||
|
|
||||||
if (!surface->buffer)
|
if (!surface->buffer)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
buffer_rect = (cairo_rectangle_int_t) {
|
buffer_rect = (MtkRectangle) {
|
||||||
.width = meta_wayland_surface_get_width (surface),
|
.width = meta_wayland_surface_get_width (surface),
|
||||||
.height = meta_wayland_surface_get_height (surface),
|
.height = meta_wayland_surface_get_height (surface),
|
||||||
};
|
};
|
||||||
|
@ -65,7 +65,7 @@ struct _MetaWaylandTextInput
|
|||||||
uint32_t anchor;
|
uint32_t anchor;
|
||||||
} surrounding;
|
} surrounding;
|
||||||
|
|
||||||
cairo_rectangle_int_t cursor_rect;
|
MtkRectangle cursor_rect;
|
||||||
|
|
||||||
uint32_t content_type_hint;
|
uint32_t content_type_hint;
|
||||||
uint32_t content_type_purpose;
|
uint32_t content_type_purpose;
|
||||||
@ -584,7 +584,7 @@ text_input_set_cursor_rectangle (struct wl_client *client,
|
|||||||
if (!client_matches_focus (text_input, client))
|
if (!client_matches_focus (text_input, client))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
text_input->cursor_rect = (cairo_rectangle_int_t) { x, y, width, height };
|
text_input->cursor_rect = (MtkRectangle) { x, y, width, height };
|
||||||
text_input->pending_state |= META_WAYLAND_PENDING_STATE_INPUT_RECT;
|
text_input->pending_state |= META_WAYLAND_PENDING_STATE_INPUT_RECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -595,7 +595,7 @@ meta_wayland_text_input_reset (MetaWaylandTextInput *text_input)
|
|||||||
text_input->content_type_hint = ZWP_TEXT_INPUT_V3_CONTENT_HINT_NONE;
|
text_input->content_type_hint = ZWP_TEXT_INPUT_V3_CONTENT_HINT_NONE;
|
||||||
text_input->content_type_purpose = ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL;
|
text_input->content_type_purpose = ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL;
|
||||||
text_input->text_change_cause = ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD;
|
text_input->text_change_cause = ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD;
|
||||||
text_input->cursor_rect = (cairo_rectangle_int_t) { 0, 0, 0, 0 };
|
text_input->cursor_rect = (MtkRectangle) { 0, 0, 0, 0 };
|
||||||
text_input->pending_state = META_WAYLAND_PENDING_STATE_NONE;
|
text_input->pending_state = META_WAYLAND_PENDING_STATE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -661,7 +661,7 @@ text_input_commit_state (struct wl_client *client,
|
|||||||
{
|
{
|
||||||
graphene_rect_t cursor_rect;
|
graphene_rect_t cursor_rect;
|
||||||
float x1, y1, x2, y2;
|
float x1, y1, x2, y2;
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
rect = text_input->cursor_rect;
|
rect = text_input->cursor_rect;
|
||||||
meta_wayland_surface_get_absolute_coordinates (text_input->surface,
|
meta_wayland_surface_get_absolute_coordinates (text_input->surface,
|
||||||
|
@ -109,7 +109,7 @@ meta_window_xwayland_adjust_fullscreen_monitor_rect (MetaWindow *window,
|
|||||||
{
|
{
|
||||||
MetaX11Display *x11_display = window->display->x11_display;
|
MetaX11Display *x11_display = window->display->x11_display;
|
||||||
MetaRectangle win_monitor_rect;
|
MetaRectangle win_monitor_rect;
|
||||||
cairo_rectangle_int_t *rects;
|
MtkRectangle *rects;
|
||||||
uint32_t *list = NULL;
|
uint32_t *list = NULL;
|
||||||
int i, n_items = 0;
|
int i, n_items = 0;
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ meta_window_xwayland_adjust_fullscreen_monitor_rect (MetaWindow *window,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rects = (cairo_rectangle_int_t *) list;
|
rects = (MtkRectangle *) list;
|
||||||
n_items = n_items / 4;
|
n_items = n_items / 4;
|
||||||
for (i = 0; i < n_items; i++)
|
for (i = 0; i < n_items; i++)
|
||||||
{
|
{
|
||||||
|
@ -672,7 +672,7 @@ reload_opaque_region (MetaWindow *window,
|
|||||||
uint32_t *region = value->v.cardinal_list.cardinals;
|
uint32_t *region = value->v.cardinal_list.cardinals;
|
||||||
int nitems = value->v.cardinal_list.n_cardinals;
|
int nitems = value->v.cardinal_list.n_cardinals;
|
||||||
|
|
||||||
cairo_rectangle_int_t *rects;
|
MtkRectangle *rects;
|
||||||
int i, rect_index, nrects;
|
int i, rect_index, nrects;
|
||||||
|
|
||||||
if (nitems % 4 != 0)
|
if (nitems % 4 != 0)
|
||||||
@ -687,13 +687,13 @@ reload_opaque_region (MetaWindow *window,
|
|||||||
|
|
||||||
nrects = nitems / 4;
|
nrects = nitems / 4;
|
||||||
|
|
||||||
rects = g_new (cairo_rectangle_int_t, nrects);
|
rects = g_new (MtkRectangle, nrects);
|
||||||
|
|
||||||
rect_index = 0;
|
rect_index = 0;
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < nitems)
|
while (i < nitems)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t *rect = &rects[rect_index];
|
MtkRectangle *rect = &rects[rect_index];
|
||||||
|
|
||||||
rect->x = region[i++];
|
rect->x = region[i++];
|
||||||
rect->y = region[i++];
|
rect->y = region[i++];
|
||||||
|
@ -2374,7 +2374,7 @@ region_create_from_x_rectangles (const XRectangle *rects,
|
|||||||
int n_rects)
|
int n_rects)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
cairo_rectangle_int_t *cairo_rects = g_newa (cairo_rectangle_int_t, n_rects);
|
MtkRectangle *cairo_rects = g_newa (MtkRectangle, n_rects);
|
||||||
|
|
||||||
for (i = 0; i < n_rects; i ++)
|
for (i = 0; i < n_rects; i ++)
|
||||||
{
|
{
|
||||||
@ -2414,7 +2414,7 @@ print_region (cairo_region_t *region)
|
|||||||
g_print ("[");
|
g_print ("[");
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
MtkRectangle rect;
|
||||||
cairo_region_get_rectangle (region, i, &rect);
|
cairo_region_get_rectangle (region, i, &rect);
|
||||||
g_print ("+%d+%dx%dx%d ",
|
g_print ("+%d+%dx%dx%d ",
|
||||||
rect.x, rect.y, rect.width, rect.height);
|
rect.x, rect.y, rect.width, rect.height);
|
||||||
@ -2506,7 +2506,7 @@ meta_window_x11_update_input_region (MetaWindow *window)
|
|||||||
|
|
||||||
if (region != NULL)
|
if (region != NULL)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t client_area;
|
MtkRectangle client_area;
|
||||||
|
|
||||||
client_area.x = 0;
|
client_area.x = 0;
|
||||||
client_area.y = 0;
|
client_area.y = 0;
|
||||||
@ -2587,7 +2587,7 @@ meta_window_x11_update_shape_region (MetaWindow *window)
|
|||||||
|
|
||||||
if (region != NULL)
|
if (region != NULL)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t client_area;
|
MtkRectangle client_area;
|
||||||
|
|
||||||
client_area.x = 0;
|
client_area.x = 0;
|
||||||
client_area.y = 0;
|
client_area.y = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user