[gtk/wip/baedert/for-master: 53/57] renderbackground: Only query h/vrepeat if we need to
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 53/57] renderbackground: Only query h/vrepeat if we need to
- Date: Sat, 27 Jun 2020 08:57:03 +0000 (UTC)
commit 8fcf1b78a44963d2251857a255e9c2d04d426e7a
Author: Timm Bäder <mail baedert org>
Date: Sun Jun 21 08:31:24 2020 +0200
renderbackground: Only query h/vrepeat if we need to
gtk/gtkrenderbackground.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkrenderbackground.c b/gtk/gtkrenderbackground.c
index fb17730900..11c9c109c6 100644
--- a/gtk/gtkrenderbackground.c
+++ b/gtk/gtkrenderbackground.c
@@ -94,9 +94,6 @@ gtk_theming_background_snapshot_layer (GtkCssBoxes *bg,
pos = _gtk_css_array_value_get_nth (background->background_position, idx);
repeat = _gtk_css_array_value_get_nth (background->background_repeat, idx);
- hrepeat = _gtk_css_background_repeat_value_get_x (repeat);
- vrepeat = _gtk_css_background_repeat_value_get_y (repeat);
-
origin = gtk_css_boxes_get_box (bg,
_gtk_css_area_value_get (
@@ -125,8 +122,13 @@ gtk_theming_background_snapshot_layer (GtkCssBoxes *bg,
/* optimization */
if (image_width == width)
hrepeat = GTK_CSS_REPEAT_STYLE_NO_REPEAT;
+ else
+ hrepeat = _gtk_css_background_repeat_value_get_x (repeat);
+
if (image_height == height)
vrepeat = GTK_CSS_REPEAT_STYLE_NO_REPEAT;
+ else
+ vrepeat = _gtk_css_background_repeat_value_get_y (repeat);
gtk_snapshot_push_debug (snapshot, "Layer %u", idx);
gtk_snapshot_push_rounded_clip (snapshot, clip);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]