- cairo_rectangle_t image_rect;
- GtkCssValue *value = _gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BACKGROUND_ORIGIN);
- GtkCssArea origin = _gtk_css_area_value_get (_gtk_css_array_value_get_nth (value, layer->idx));
-
- /* The default size of the background image depends on the
- background-origin value as this affects the top left
- and the bottom right corners. */
- switch (origin) {
- case GTK_CSS_AREA_BORDER_BOX:
- image_rect.x = 0;
- image_rect.y = 0;
- image_rect.width = bg->paint_area.width;
- image_rect.height = bg->paint_area.height;
- break;
- case GTK_CSS_AREA_CONTENT_BOX:
- image_rect.x = bg->border.left + bg->padding.left;
- image_rect.y = bg->border.top + bg->padding.top;
- image_rect.width = bg->paint_area.width - bg->border.left - bg->border.right - bg->padding.left - bg->padding.right;
- image_rect.height = bg->paint_area.height - bg->border.top - bg->border.bottom - bg->padding.top - bg->padding.bottom;
- break;
- case GTK_CSS_AREA_PADDING_BOX:
- default:
- image_rect.x = bg->border.left;
- image_rect.y = bg->border.top;
- image_rect.width = bg->paint_area.width - bg->border.left - bg->border.right;
- image_rect.height = bg->paint_area.height - bg->border.top - bg->border.bottom;
- break;
- }
-
- /* XXX: image_rect might have negative width/height here.
- * Do we need to do something about it? */
- layer->image_rect = image_rect;
-}
-
-static void
-_gtk_theming_background_apply_clip (GtkThemingBackground *bg,
- GtkRoundedBox *box,
- GtkCssArea clip)
-{
- if (clip == GTK_CSS_AREA_PADDING_BOX)