Support border-image in theme_engine_render_frame_gap

This is similar to the normal frame rendering, but has a clip
region applied for the gap.
This commit is contained in:
Alexander Larsson 2011-11-28 10:05:29 +01:00
parent 267b51ec98
commit eb44036346

View File

@ -2344,14 +2344,20 @@ gtk_theming_engine_render_frame_gap (GtkThemingEngine *engine,
GtkCssBorderCornerRadius *bottom_left_radius, *bottom_right_radius; GtkCssBorderCornerRadius *bottom_left_radius, *bottom_right_radius;
GtkCssBorderRadius border_radius = { { 0, }, }; GtkCssBorderRadius border_radius = { { 0, }, };
gdouble x0, y0, x1, y1, xc, yc, wc, hc; gdouble x0, y0, x1, y1, xc, yc, wc, hc;
GtkStylePropertyContext context;
GtkBorderImage *border_image;
GtkBorder border; GtkBorder border;
xc = yc = wc = hc = 0; xc = yc = wc = hc = 0;
state = gtk_theming_engine_get_state (engine); state = gtk_theming_engine_get_state (engine);
junction = gtk_theming_engine_get_junction_sides (engine); junction = gtk_theming_engine_get_junction_sides (engine);
context.width = width;
context.height = height;
gtk_theming_engine_get_border (engine, state, &border); gtk_theming_engine_get_border (engine, state, &border);
gtk_theming_engine_get (engine, state, _gtk_theming_engine_get (engine, state, &context,
"border-image", &border_image,
/* Can't use border-radius as it's an int for /* Can't use border-radius as it's an int for
* backwards compat */ * backwards compat */
"border-top-left-radius", &top_left_radius, "border-top-left-radius", &top_left_radius,
@ -2440,6 +2446,13 @@ gtk_theming_engine_render_frame_gap (GtkThemingEngine *engine,
cairo_rectangle (cr, x0, yc + hc, x1 - x0, y1 - (yc + hc)); cairo_rectangle (cr, x0, yc + hc, x1 - x0, y1 - (yc + hc));
cairo_clip (cr); cairo_clip (cr);
if (border_image != NULL)
{
_gtk_border_image_render (border_image, &border,
cr, x, y, width, height);
_gtk_border_image_unref (border_image);
}
else
render_frame_internal (engine, cr, render_frame_internal (engine, cr,
x, y, width, height, x, y, width, height,
0, junction); 0, junction);