frames: We don't need to pass in the frame rect to get_bounds either

The MetaFrameGeometry already has this information.
This commit is contained in:
Jasper St. Pierre 2015-01-01 10:33:27 -08:00
parent 4d3511649b
commit dcce4e64bc
3 changed files with 8 additions and 16 deletions

View File

@ -379,7 +379,7 @@ meta_frame_sync_to_window (MetaFrame *frame,
cairo_region_t * cairo_region_t *
meta_frame_get_frame_bounds (MetaFrame *frame) meta_frame_get_frame_bounds (MetaFrame *frame)
{ {
return meta_ui_frame_get_bounds (frame->ui_frame, frame->rect.width, frame->rect.height); return meta_ui_frame_get_bounds (frame->ui_frame);
} }
void void

View File

@ -620,21 +620,17 @@ get_client_rect (MetaFrameGeometry *fgeom,
*/ */
static void static void
get_visible_frame_rect (MetaFrameGeometry *fgeom, get_visible_frame_rect (MetaFrameGeometry *fgeom,
int window_width,
int window_height,
cairo_rectangle_int_t *rect) cairo_rectangle_int_t *rect)
{ {
rect->x = fgeom->borders.invisible.left; rect->x = fgeom->borders.invisible.left;
rect->y = fgeom->borders.invisible.top; rect->y = fgeom->borders.invisible.top;
rect->width = window_width - fgeom->borders.invisible.right - rect->x; rect->width = fgeom->width - fgeom->borders.invisible.right - rect->x;
rect->height = window_height - fgeom->borders.invisible.bottom - rect->y; rect->height = fgeom->height - fgeom->borders.invisible.bottom - rect->y;
} }
static cairo_region_t * static cairo_region_t *
get_visible_region (MetaUIFrame *frame, get_visible_region (MetaUIFrame *frame,
MetaFrameGeometry *fgeom, MetaFrameGeometry *fgeom)
int window_width,
int window_height)
{ {
cairo_region_t *corners_region; cairo_region_t *corners_region;
cairo_region_t *visible_region; cairo_region_t *visible_region;
@ -642,7 +638,7 @@ get_visible_region (MetaUIFrame *frame,
cairo_rectangle_int_t frame_rect; cairo_rectangle_int_t frame_rect;
corners_region = cairo_region_create (); corners_region = cairo_region_create ();
get_visible_frame_rect (fgeom, window_width, window_height, &frame_rect); get_visible_frame_rect (fgeom, &frame_rect);
if (fgeom->top_left_corner_rounded_radius != 0) if (fgeom->top_left_corner_rounded_radius != 0)
{ {
@ -724,13 +720,11 @@ get_visible_region (MetaUIFrame *frame,
} }
cairo_region_t * cairo_region_t *
meta_ui_frame_get_bounds (MetaUIFrame *frame, meta_ui_frame_get_bounds (MetaUIFrame *frame)
int window_width,
int window_height)
{ {
MetaFrameGeometry fgeom; MetaFrameGeometry fgeom;
meta_ui_frame_calc_geometry (frame, &fgeom); meta_ui_frame_calc_geometry (frame, &fgeom);
return get_visible_region (frame, &fgeom, window_width, window_height); return get_visible_region (frame, &fgeom);
} }
void void

View File

@ -135,9 +135,7 @@ void meta_ui_frame_repaint (MetaUIFrame *frame);
void meta_ui_frame_get_borders (MetaUIFrame *frame, void meta_ui_frame_get_borders (MetaUIFrame *frame,
MetaFrameBorders *borders); MetaFrameBorders *borders);
cairo_region_t * meta_ui_frame_get_bounds (MetaUIFrame *frame, cairo_region_t * meta_ui_frame_get_bounds (MetaUIFrame *frame);
int window_width,
int window_height);
void meta_ui_frame_get_mask (MetaUIFrame *frame, void meta_ui_frame_get_mask (MetaUIFrame *frame,
cairo_t *cr); cairo_t *cr);