diff options
author | Benjamin Otte <otte@redhat.com> | 2016-11-19 20:38:22 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-11-19 20:58:36 +0100 |
commit | 38f226b5cef1660c7a7f465528befbd65ab944a5 (patch) | |
tree | 26d143caa6aaf77daa9898fc95f363a83d78a412 /gtk/gtkcssshadowsvalue.c | |
parent | c45f8b1a25c4ef06773c06d30c30199097d29d96 (diff) | |
download | gtk+-38f226b5cef1660c7a7f465528befbd65ab944a5.tar.gz |
render: Propagate snapshot drawing to box shadows
This decouples actual background drawing from shadow drawing in the
snapshot case.
We also now create seperate nodes for shadows vs for backgrounds.
Diffstat (limited to 'gtk/gtkcssshadowsvalue.c')
-rw-r--r-- | gtk/gtkcssshadowsvalue.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gtk/gtkcssshadowsvalue.c b/gtk/gtkcssshadowsvalue.c index e2be207ad6..18381553ac 100644 --- a/gtk/gtkcssshadowsvalue.c +++ b/gtk/gtkcssshadowsvalue.c @@ -316,6 +316,42 @@ _gtk_css_shadows_value_paint_box (const GtkCssValue *shadows, } void +gtk_css_shadows_value_snapshot_outset (const GtkCssValue *shadows, + GtkSnapshot *snapshot, + const GtkRoundedBox *border_box) +{ + guint i; + + g_return_if_fail (shadows->class == >K_CSS_VALUE_SHADOWS); + + for (i = 0; i < shadows->len; i++) + { + if (_gtk_css_shadow_value_get_inset (shadows->values[i])) + continue; + + gtk_css_shadow_value_snapshot_outset (shadows->values[i], snapshot, border_box); + } +} + +void +gtk_css_shadows_value_snapshot_inset (const GtkCssValue *shadows, + GtkSnapshot *snapshot, + const GtkRoundedBox *padding_box) +{ + guint i; + + g_return_if_fail (shadows->class == >K_CSS_VALUE_SHADOWS); + + for (i = 0; i < shadows->len; i++) + { + if (!_gtk_css_shadow_value_get_inset (shadows->values[i])) + continue; + + gtk_css_shadow_value_snapshot_inset (shadows->values[i], snapshot, padding_box); + } +} + +void _gtk_css_shadows_value_get_extents (const GtkCssValue *shadows, GtkBorder *border) { |