MetaWindowActor: Don't use truncated values when drawing the cairo overlay path

This was causing visual artifacts on large border radius values.
This commit is contained in:
Jasper St. Pierre 2011-08-26 21:19:49 -04:00
parent dcfa6986c6
commit 978e601217

View File

@ -2008,6 +2008,7 @@ update_corners (MetaWindowActor *self,
cairo_region_t *corner_region; cairo_region_t *corner_region;
cairo_path_t *corner_path; cairo_path_t *corner_path;
float top_left, top_right, bottom_left, bottom_right; float top_left, top_right, bottom_left, bottom_right;
float x, y;
/* need these to build a path */ /* need these to build a path */
cairo_t *cr; cairo_t *cr;
@ -2033,50 +2034,55 @@ update_corners (MetaWindowActor *self,
cr = cairo_create (surface); cr = cairo_create (surface);
/* top left */ /* top left */
x = borders->invisible.left;
y = borders->invisible.top;
set_integral_bounding_rect (&corner_rects[0], set_integral_bounding_rect (&corner_rects[0],
borders->invisible.left, x, y, top_left, top_left);
borders->invisible.top,
top_left, top_left);
cairo_arc (cr, cairo_arc (cr,
corner_rects[0].x + top_left, x + top_left,
corner_rects[0].y + top_left, y + top_left,
top_left, top_left,
0, M_PI*2); 0, M_PI*2);
/* top right */ /* top right */
x = borders->invisible.left + outer.width - top_right;
y = borders->invisible.top;
set_integral_bounding_rect (&corner_rects[1], set_integral_bounding_rect (&corner_rects[1],
borders->invisible.left + outer.width - top_right, x, y, top_right, top_right);
borders->invisible.top,
top_right, top_right);
cairo_arc (cr, cairo_arc (cr,
corner_rects[1].x, x,
corner_rects[1].y + top_right, y + top_right,
top_right, top_right,
0, M_PI*2); 0, M_PI*2);
/* bottom left */ /* bottom left */
x = borders->invisible.left;
y = borders->invisible.top + outer.height - bottom_left;
set_integral_bounding_rect (&corner_rects[2], set_integral_bounding_rect (&corner_rects[2],
borders->invisible.left, x, y, bottom_left, bottom_left);
borders->invisible.top + outer.height - bottom_left,
bottom_left, bottom_left);
cairo_arc (cr, cairo_arc (cr,
corner_rects[2].x + bottom_left, x + bottom_left,
corner_rects[2].y, y,
bottom_left, bottom_left,
0, M_PI*2); 0, M_PI*2);
/* bottom right */ /* bottom right */
x = borders->invisible.left + outer.width - bottom_right;
y = borders->invisible.top + outer.height - bottom_right;
set_integral_bounding_rect (&corner_rects[3], set_integral_bounding_rect (&corner_rects[3],
borders->invisible.left + outer.width - bottom_right, x, y, bottom_right, bottom_right);
borders->invisible.top + outer.height - bottom_right,
bottom_right, bottom_right);
cairo_arc (cr, cairo_arc (cr,
corner_rects[3].x, x,
corner_rects[3].y, y,
bottom_right, bottom_right,
0, M_PI*2); 0, M_PI*2);