[gtk+/wip/window-scales: 61/69] css: Add a scale argument to css-value compute vfunc



commit 0f837618eddbc1ce78a9eb85fb447cdaef3a9120
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Jun 27 18:26:05 2013 +0200

    css: Add a scale argument to css-value compute vfunc
    
    We need to be able to compute different GtkCssImage values
    depending on the scale, and we need this at compute time so that
    we don't need to read any images other than the scale in used (to
    e.g. calculate the image size). GtkStyleProviderPrivate is shared
    for all style contexts, so its not right.

 gtk/gtkcssarrayvalue.c            |    3 ++-
 gtk/gtkcssbgsizevalue.c           |    5 +++--
 gtk/gtkcssbordervalue.c           |    3 ++-
 gtk/gtkcsscolorvalue.c            |    5 ++++-
 gtk/gtkcsscomputedvalues.c        |    9 ++++++---
 gtk/gtkcsscomputedvaluesprivate.h |    2 ++
 gtk/gtkcsscornervalue.c           |    5 +++--
 gtk/gtkcsseasevalue.c             |    1 +
 gtk/gtkcssenginevalue.c           |    1 +
 gtk/gtkcssenumvalue.c             |    2 ++
 gtk/gtkcssimage.c                 |    4 +++-
 gtk/gtkcssimagegradient.c         |    1 +
 gtk/gtkcssimagelinear.c           |    7 ++++---
 gtk/gtkcssimageprivate.h          |    2 ++
 gtk/gtkcssimageurl.c              |    1 +
 gtk/gtkcssimagevalue.c            |    3 ++-
 gtk/gtkcssinheritvalue.c          |    2 ++
 gtk/gtkcssinitialvalue.c          |    2 ++
 gtk/gtkcsskeyframes.c             |    2 ++
 gtk/gtkcsskeyframesprivate.h      |    1 +
 gtk/gtkcsslookup.c                |    2 ++
 gtk/gtkcsslookupprivate.h         |    1 +
 gtk/gtkcssnumbervalue.c           |    1 +
 gtk/gtkcsspositionvalue.c         |    5 +++--
 gtk/gtkcssrepeatvalue.c           |    1 +
 gtk/gtkcssrgbavalue.c             |    1 +
 gtk/gtkcssshadowsvalue.c          |    3 ++-
 gtk/gtkcssshadowvalue.c           |   11 ++++++-----
 gtk/gtkcssstringvalue.c           |    1 +
 gtk/gtkcsstypedvalue.c            |    1 +
 gtk/gtkcssvalue.c                 |    3 ++-
 gtk/gtkcssvalueprivate.h          |    2 ++
 gtk/gtkstylecontext.c             |    1 +
 33 files changed, 70 insertions(+), 24 deletions(-)
---
diff --git a/gtk/gtkcssarrayvalue.c b/gtk/gtkcssarrayvalue.c
index 45f1fb2..a221bf6 100644
--- a/gtk/gtkcssarrayvalue.c
+++ b/gtk/gtkcssarrayvalue.c
@@ -46,6 +46,7 @@ static GtkCssValue *
 gtk_css_value_array_compute (GtkCssValue             *value,
                              guint                    property_id,
                              GtkStyleProviderPrivate *provider,
+                            int                      scale,
                              GtkCssComputedValues    *values,
                              GtkCssComputedValues    *parent_values,
                              GtkCssDependencies      *dependencies)
@@ -58,7 +59,7 @@ gtk_css_value_array_compute (GtkCssValue             *value,
   result = NULL;
   for (i = 0; i < value->n_values; i++)
     {
-      i_value =  _gtk_css_value_compute (value->values[i], property_id, provider, values, parent_values, 
&child_deps);
+      i_value =  _gtk_css_value_compute (value->values[i], property_id, provider, scale, values, 
parent_values, &child_deps);
 
       *dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
 
diff --git a/gtk/gtkcssbgsizevalue.c b/gtk/gtkcssbgsizevalue.c
index 662ceb7..df29d97 100644
--- a/gtk/gtkcssbgsizevalue.c
+++ b/gtk/gtkcssbgsizevalue.c
@@ -44,6 +44,7 @@ static GtkCssValue *
 gtk_css_value_bg_size_compute (GtkCssValue             *value,
                                guint                    property_id,
                                GtkStyleProviderPrivate *provider,
+                              int                      scale,
                                GtkCssComputedValues    *values,
                                GtkCssComputedValues    *parent_values,
                                GtkCssDependencies      *dependencies)
@@ -58,10 +59,10 @@ gtk_css_value_bg_size_compute (GtkCssValue             *value,
   x = y = NULL;
 
   if (value->x)
-    x = _gtk_css_value_compute (value->x, property_id, provider, values, parent_values, &x_deps);
+    x = _gtk_css_value_compute (value->x, property_id, provider, scale, values, parent_values, &x_deps);
 
   if (value->y)
-    y = _gtk_css_value_compute (value->y, property_id, provider, values, parent_values, &y_deps);
+    y = _gtk_css_value_compute (value->y, property_id, provider, scale, values, parent_values, &y_deps);
 
   *dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
 
diff --git a/gtk/gtkcssbordervalue.c b/gtk/gtkcssbordervalue.c
index 62487f8..998e432 100644
--- a/gtk/gtkcssbordervalue.c
+++ b/gtk/gtkcssbordervalue.c
@@ -45,6 +45,7 @@ static GtkCssValue *
 gtk_css_value_border_compute (GtkCssValue             *value,
                               guint                    property_id,
                               GtkStyleProviderPrivate *provider,
+                             int                      scale,
                               GtkCssComputedValues    *values,
                               GtkCssComputedValues    *parent_values,
                               GtkCssDependencies       *dependencies)
@@ -61,7 +62,7 @@ gtk_css_value_border_compute (GtkCssValue             *value,
     {
       if (value->values[i])
         {
-          computed->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, values, 
parent_values, &child_deps);
+          computed->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, scale, 
values, parent_values, &child_deps);
           *dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
           changed |= (computed->values[i] != value->values[i]);
         }
diff --git a/gtk/gtkcsscolorvalue.c b/gtk/gtkcsscolorvalue.c
index d523fe8..9972d96 100644
--- a/gtk/gtkcsscolorvalue.c
+++ b/gtk/gtkcsscolorvalue.c
@@ -101,6 +101,7 @@ gtk_css_value_color_free (GtkCssValue *color)
 static GtkCssValue *
 gtk_css_value_color_get_fallback (guint                    property_id,
                                   GtkStyleProviderPrivate *provider,
+                                 int                      scale,
                                   GtkCssComputedValues    *values,
                                   GtkCssComputedValues    *parent_values)
 {
@@ -124,6 +125,7 @@ gtk_css_value_color_get_fallback (guint                    property_id,
         return _gtk_css_value_compute (_gtk_css_style_property_get_initial_value 
(_gtk_css_style_property_lookup_by_id (property_id)),
                                        property_id,
                                        provider,
+                                      scale,
                                        values,
                                        parent_values,
                                        NULL);
@@ -297,6 +299,7 @@ static GtkCssValue *
 gtk_css_value_color_compute (GtkCssValue             *value,
                              guint                    property_id,
                              GtkStyleProviderPrivate *provider,
+                            int                      scale,
                              GtkCssComputedValues    *values,
                              GtkCssComputedValues    *parent_values,
                              GtkCssDependencies      *dependencies)
@@ -335,7 +338,7 @@ gtk_css_value_color_compute (GtkCssValue             *value,
                                            NULL);
 
   if (resolved == NULL)
-    return gtk_css_value_color_get_fallback (property_id, provider, values, parent_values);
+    return gtk_css_value_color_get_fallback (property_id, provider, scale, values, parent_values);
 
   return resolved;
 }
diff --git a/gtk/gtkcsscomputedvalues.c b/gtk/gtkcsscomputedvalues.c
index dea23bd..6f7d368 100644
--- a/gtk/gtkcsscomputedvalues.c
+++ b/gtk/gtkcsscomputedvalues.c
@@ -113,6 +113,7 @@ maybe_unref_section (gpointer section)
 void
 _gtk_css_computed_values_compute_value (GtkCssComputedValues    *values,
                                         GtkStyleProviderPrivate *provider,
+                                       int                      scale,
                                         GtkCssComputedValues    *parent_values,
                                         guint                    id,
                                         GtkCssValue             *specified,
@@ -142,7 +143,7 @@ _gtk_css_computed_values_compute_value (GtkCssComputedValues    *values,
   else
     _gtk_css_value_ref (specified);
 
-  value = _gtk_css_value_compute (specified, id, provider, values, parent_values, &dependencies);
+  value = _gtk_css_value_compute (specified, id, provider, scale, values, parent_values, &dependencies);
 
   _gtk_css_computed_values_set_value (values, id, value, dependencies, section);
 
@@ -445,6 +446,7 @@ gtk_css_computed_values_create_css_animations (GtkCssComputedValues    *values,
                                                GtkCssComputedValues    *parent_values,
                                                gint64                   timestamp,
                                                GtkStyleProviderPrivate *provider,
+                                              int                      scale,
                                                GtkCssComputedValues    *source)
 {
   GtkCssValue *durations, *delays, *timing_functions, *animations;
@@ -489,7 +491,7 @@ gtk_css_computed_values_create_css_animations (GtkCssComputedValues    *values,
           if (keyframes == NULL)
             continue;
 
-          keyframes = _gtk_css_keyframes_compute (keyframes, provider, values, parent_values);
+          keyframes = _gtk_css_keyframes_compute (keyframes, provider, scale, values, parent_values);
 
           animation = _gtk_css_animation_new (name,
                                               keyframes,
@@ -514,11 +516,12 @@ _gtk_css_computed_values_create_animations (GtkCssComputedValues    *values,
                                             GtkCssComputedValues    *parent_values,
                                             gint64                   timestamp,
                                             GtkStyleProviderPrivate *provider,
+                                           int                      scale,
                                             GtkCssComputedValues    *source)
 {
   if (source != NULL)
     gtk_css_computed_values_create_css_transitions (values, timestamp, source);
-  gtk_css_computed_values_create_css_animations (values, parent_values, timestamp, provider, source);
+  gtk_css_computed_values_create_css_animations (values, parent_values, timestamp, provider, scale, source);
 }
 
 GtkBitmask *
diff --git a/gtk/gtkcsscomputedvaluesprivate.h b/gtk/gtkcsscomputedvaluesprivate.h
index 5c88c72..f70d397 100644
--- a/gtk/gtkcsscomputedvaluesprivate.h
+++ b/gtk/gtkcsscomputedvaluesprivate.h
@@ -66,6 +66,7 @@ GtkCssComputedValues *  _gtk_css_computed_values_new                  (void);
 
 void                    _gtk_css_computed_values_compute_value        (GtkCssComputedValues     *values,
                                                                        GtkStyleProviderPrivate  *provider,
+                                                                      int                       scale,
                                                                        GtkCssComputedValues     
*parent_values,
                                                                        guint                     id,
                                                                        GtkCssValue              *specified,
@@ -94,6 +95,7 @@ void                    _gtk_css_computed_values_create_animations    (GtkCssCom
                                                                        GtkCssComputedValues     
*parent_values,
                                                                        gint64                    timestamp,
                                                                        GtkStyleProviderPrivate  *provider,
+                                                                      int                       scale,
                                                                        GtkCssComputedValues     *source);
 GtkBitmask *            _gtk_css_computed_values_advance              (GtkCssComputedValues     *values,
                                                                        gint64                    timestamp);
diff --git a/gtk/gtkcsscornervalue.c b/gtk/gtkcsscornervalue.c
index 394675c..625e802 100644
--- a/gtk/gtkcsscornervalue.c
+++ b/gtk/gtkcsscornervalue.c
@@ -40,6 +40,7 @@ static GtkCssValue *
 gtk_css_value_corner_compute (GtkCssValue             *corner,
                               guint                    property_id,
                               GtkStyleProviderPrivate *provider,
+                             int                      scale,
                               GtkCssComputedValues    *values,
                               GtkCssComputedValues    *parent_values,
                               GtkCssDependencies      *dependencies)
@@ -47,8 +48,8 @@ gtk_css_value_corner_compute (GtkCssValue             *corner,
   GtkCssValue *x, *y;
   GtkCssDependencies x_deps, y_deps;
 
-  x = _gtk_css_value_compute (corner->x, property_id, provider, values, parent_values, &x_deps);
-  y = _gtk_css_value_compute (corner->y, property_id, provider, values, parent_values, &y_deps);
+  x = _gtk_css_value_compute (corner->x, property_id, provider, scale, values, parent_values, &x_deps);
+  y = _gtk_css_value_compute (corner->y, property_id, provider, scale, values, parent_values, &y_deps);
   *dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
   if (x == corner->x && y == corner->y)
     {
diff --git a/gtk/gtkcsseasevalue.c b/gtk/gtkcsseasevalue.c
index 81cdea8..f4d56fd 100644
--- a/gtk/gtkcsseasevalue.c
+++ b/gtk/gtkcsseasevalue.c
@@ -53,6 +53,7 @@ static GtkCssValue *
 gtk_css_value_ease_compute (GtkCssValue             *value,
                             guint                    property_id,
                             GtkStyleProviderPrivate *provider,
+                           int                      scale,
                             GtkCssComputedValues    *values,
                             GtkCssComputedValues    *parent_values,
                             GtkCssDependencies      *dependencies)
diff --git a/gtk/gtkcssenginevalue.c b/gtk/gtkcssenginevalue.c
index f382df9..08575b2 100644
--- a/gtk/gtkcssenginevalue.c
+++ b/gtk/gtkcssenginevalue.c
@@ -38,6 +38,7 @@ static GtkCssValue *
 gtk_css_value_engine_compute (GtkCssValue             *value,
                               guint                    property_id,
                               GtkStyleProviderPrivate *provider,
+                             int                      scale,
                               GtkCssComputedValues    *values,
                               GtkCssComputedValues    *parent_values,
                               GtkCssDependencies      *dependencies)
diff --git a/gtk/gtkcssenumvalue.c b/gtk/gtkcssenumvalue.c
index e1f1d1c..547edb8 100644
--- a/gtk/gtkcssenumvalue.c
+++ b/gtk/gtkcssenumvalue.c
@@ -41,6 +41,7 @@ static GtkCssValue *
 gtk_css_value_enum_compute (GtkCssValue             *value,
                             guint                    property_id,
                             GtkStyleProviderPrivate *provider,
+                           int                      scale,
                             GtkCssComputedValues    *values,
                             GtkCssComputedValues    *parent_values,
                             GtkCssDependencies      *dependencies)
@@ -164,6 +165,7 @@ static GtkCssValue *
 gtk_css_value_font_size_compute (GtkCssValue             *value,
                                  guint                    property_id,
                                  GtkStyleProviderPrivate *provider,
+                                int                      scale,
                                  GtkCssComputedValues    *values,
                                  GtkCssComputedValues    *parent_values,
                                  GtkCssDependencies      *dependencies)
diff --git a/gtk/gtkcssimage.c b/gtk/gtkcssimage.c
index a687278..ff78450 100644
--- a/gtk/gtkcssimage.c
+++ b/gtk/gtkcssimage.c
@@ -62,6 +62,7 @@ static GtkCssImage *
 gtk_css_image_real_compute (GtkCssImage             *image,
                             guint                    property_id,
                             GtkStyleProviderPrivate *provider,
+                           int                      scale,
                             GtkCssComputedValues    *values,
                             GtkCssComputedValues    *parent_values,
                             GtkCssDependencies      *dependencies)
@@ -146,6 +147,7 @@ GtkCssImage *
 _gtk_css_image_compute (GtkCssImage             *image,
                         guint                    property_id,
                         GtkStyleProviderPrivate *provider,
+                       int                      scale,
                         GtkCssComputedValues    *values,
                         GtkCssComputedValues    *parent_values,
                         GtkCssDependencies      *dependencies)
@@ -163,7 +165,7 @@ _gtk_css_image_compute (GtkCssImage             *image,
 
   klass = GTK_CSS_IMAGE_GET_CLASS (image);
 
-  return klass->compute (image, property_id, provider, values, parent_values, dependencies);
+  return klass->compute (image, property_id, provider, scale, values, parent_values, dependencies);
 }
 
 GtkCssImage *
diff --git a/gtk/gtkcssimagegradient.c b/gtk/gtkcssimagegradient.c
index cc06c90..93ae750 100644
--- a/gtk/gtkcssimagegradient.c
+++ b/gtk/gtkcssimagegradient.c
@@ -34,6 +34,7 @@ static GtkCssImage *
 gtk_css_image_gradient_compute (GtkCssImage             *image,
                                 guint                    property_id,
                                 GtkStyleProviderPrivate *provider,
+                               int                      scale,
                                 GtkCssComputedValues    *values,
                                 GtkCssComputedValues    *parent_values,
                                 GtkCssDependencies      *dependencies)
diff --git a/gtk/gtkcssimagelinear.c b/gtk/gtkcssimagelinear.c
index 0d9f866..9268d2b 100644
--- a/gtk/gtkcssimagelinear.c
+++ b/gtk/gtkcssimagelinear.c
@@ -420,6 +420,7 @@ static GtkCssImage *
 gtk_css_image_linear_compute (GtkCssImage             *image,
                               guint                    property_id,
                               GtkStyleProviderPrivate *provider,
+                             int                      scale,
                               GtkCssComputedValues    *values,
                               GtkCssComputedValues    *parent_values,
                               GtkCssDependencies      *dependencies)
@@ -431,7 +432,7 @@ gtk_css_image_linear_compute (GtkCssImage             *image,
   copy = g_object_new (GTK_TYPE_CSS_IMAGE_LINEAR, NULL);
   copy->repeating = linear->repeating;
 
-  copy->angle = _gtk_css_value_compute (linear->angle, property_id, provider, values, parent_values, 
dependencies);
+  copy->angle = _gtk_css_value_compute (linear->angle, property_id, provider, scale, values, parent_values, 
dependencies);
   
   g_array_set_size (copy->stops, linear->stops->len);
   for (i = 0; i < linear->stops->len; i++)
@@ -442,12 +443,12 @@ gtk_css_image_linear_compute (GtkCssImage             *image,
       stop = &g_array_index (linear->stops, GtkCssImageLinearColorStop, i);
       scopy = &g_array_index (copy->stops, GtkCssImageLinearColorStop, i);
               
-      scopy->color = _gtk_css_value_compute (stop->color, property_id, provider, values, parent_values, 
&child_deps);
+      scopy->color = _gtk_css_value_compute (stop->color, property_id, provider, scale, values, 
parent_values, &child_deps);
       *dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
       
       if (stop->offset)
         {
-          scopy->offset = _gtk_css_value_compute (stop->offset, property_id, provider, values, 
parent_values, &child_deps);
+          scopy->offset = _gtk_css_value_compute (stop->offset, property_id, provider, scale, values, 
parent_values, &child_deps);
           *dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
         }
       else
diff --git a/gtk/gtkcssimageprivate.h b/gtk/gtkcssimageprivate.h
index f9e4e41..e9a39bf 100644
--- a/gtk/gtkcssimageprivate.h
+++ b/gtk/gtkcssimageprivate.h
@@ -58,6 +58,7 @@ struct _GtkCssImageClass
   GtkCssImage *(* compute)                         (GtkCssImage                *image,
                                                     guint                       property_id,
                                                     GtkStyleProviderPrivate    *provider,
+                                                   int                         scale,
                                                     GtkCssComputedValues       *values,
                                                     GtkCssComputedValues       *parent_values,
                                                     GtkCssDependencies         *dependencies);
@@ -95,6 +96,7 @@ double         _gtk_css_image_get_aspect_ratio     (GtkCssImage                *
 GtkCssImage *  _gtk_css_image_compute              (GtkCssImage                *image,
                                                     guint                       property_id,
                                                     GtkStyleProviderPrivate    *provider,
+                                                   int                        scale,
                                                     GtkCssComputedValues       *values,
                                                     GtkCssComputedValues       *parent_values,
                                                     GtkCssDependencies         *dependencies);
diff --git a/gtk/gtkcssimageurl.c b/gtk/gtkcssimageurl.c
index 0a7c4f3..663b6dc 100644
--- a/gtk/gtkcssimageurl.c
+++ b/gtk/gtkcssimageurl.c
@@ -120,6 +120,7 @@ static GtkCssImage *
 gtk_css_image_url_compute (GtkCssImage             *image,
                            guint                    property_id,
                            GtkStyleProviderPrivate *provider,
+                          int                      scale,
                            GtkCssComputedValues    *values,
                            GtkCssComputedValues    *parent_values,
                            GtkCssDependencies      *dependencies)
diff --git a/gtk/gtkcssimagevalue.c b/gtk/gtkcssimagevalue.c
index dac0c2f..4dcba24 100644
--- a/gtk/gtkcssimagevalue.c
+++ b/gtk/gtkcssimagevalue.c
@@ -37,6 +37,7 @@ static GtkCssValue *
 gtk_css_value_image_compute (GtkCssValue             *value,
                              guint                    property_id,
                              GtkStyleProviderPrivate *provider,
+                            int                      scale,
                              GtkCssComputedValues    *values,
                              GtkCssComputedValues    *parent_values,
                              GtkCssDependencies      *dependencies)
@@ -48,7 +49,7 @@ gtk_css_value_image_compute (GtkCssValue             *value,
   if (image == NULL)
     return _gtk_css_value_ref (value);
 
-  computed = _gtk_css_image_compute (image, property_id, provider, values, parent_values, dependencies);
+  computed = _gtk_css_image_compute (image, property_id, provider, scale, values, parent_values, 
dependencies);
 
   if (computed == image)
     {
diff --git a/gtk/gtkcssinheritvalue.c b/gtk/gtkcssinheritvalue.c
index e2c3f16..053245c 100644
--- a/gtk/gtkcssinheritvalue.c
+++ b/gtk/gtkcssinheritvalue.c
@@ -37,6 +37,7 @@ static GtkCssValue *
 gtk_css_value_inherit_compute (GtkCssValue             *value,
                                guint                    property_id,
                                GtkStyleProviderPrivate *provider,
+                              int                      scale,
                                GtkCssComputedValues    *values,
                                GtkCssComputedValues    *parent_values,
                                GtkCssDependencies      *dependencies)
@@ -51,6 +52,7 @@ gtk_css_value_inherit_compute (GtkCssValue             *value,
       return _gtk_css_value_compute (_gtk_css_initial_value_get (),
                                      property_id,
                                      provider,
+                                    scale,
                                      values,
                                      parent_values,
                                      dependencies);
diff --git a/gtk/gtkcssinitialvalue.c b/gtk/gtkcssinitialvalue.c
index 427044d..c53a5cf 100644
--- a/gtk/gtkcssinitialvalue.c
+++ b/gtk/gtkcssinitialvalue.c
@@ -40,6 +40,7 @@ static GtkCssValue *
 gtk_css_value_initial_compute (GtkCssValue             *value,
                                guint                    property_id,
                                GtkStyleProviderPrivate *provider,
+                              int                      scale,
                                GtkCssComputedValues    *values,
                                GtkCssComputedValues    *parent_values,
                                GtkCssDependencies      *dependencies)
@@ -80,6 +81,7 @@ gtk_css_value_initial_compute (GtkCssValue             *value,
   return _gtk_css_value_compute (_gtk_css_style_property_get_initial_value 
(_gtk_css_style_property_lookup_by_id (property_id)),
                                  property_id,
                                  provider,
+                                scale,
                                  values,
                                  parent_values,
                                  dependencies);
diff --git a/gtk/gtkcsskeyframes.c b/gtk/gtkcsskeyframes.c
index dc214b2..f25b0c4 100644
--- a/gtk/gtkcsskeyframes.c
+++ b/gtk/gtkcsskeyframes.c
@@ -427,6 +427,7 @@ _gtk_css_keyframes_print (GtkCssKeyframes *keyframes,
 GtkCssKeyframes *
 _gtk_css_keyframes_compute (GtkCssKeyframes         *keyframes,
                             GtkStyleProviderPrivate *provider,
+                           int                      scale,
                             GtkCssComputedValues    *values,
                             GtkCssComputedValues    *parent_values)
 {
@@ -455,6 +456,7 @@ _gtk_css_keyframes_compute (GtkCssKeyframes         *keyframes,
           KEYFRAMES_VALUE (resolved, k, p) =  _gtk_css_value_compute (KEYFRAMES_VALUE (keyframes, k, p),
                                                                       resolved->property_ids[p],
                                                                       provider,
+                                                                     scale,
                                                                       values,
                                                                       parent_values,
                                                                       NULL);
diff --git a/gtk/gtkcsskeyframesprivate.h b/gtk/gtkcsskeyframesprivate.h
index 9ec76fe..160d4c5 100644
--- a/gtk/gtkcsskeyframesprivate.h
+++ b/gtk/gtkcsskeyframesprivate.h
@@ -38,6 +38,7 @@ void                _gtk_css_keyframes_print                  (GtkCssKeyframes
 
 GtkCssKeyframes *   _gtk_css_keyframes_compute                (GtkCssKeyframes         *keyframes,
                                                                GtkStyleProviderPrivate *provider,
+                                                              int                      scale,
                                                                GtkCssComputedValues    *values,
                                                                GtkCssComputedValues    *parent_values);
 
diff --git a/gtk/gtkcsslookup.c b/gtk/gtkcsslookup.c
index acd35b6..a32b959 100644
--- a/gtk/gtkcsslookup.c
+++ b/gtk/gtkcsslookup.c
@@ -140,6 +140,7 @@ _gtk_css_lookup_set_computed (GtkCssLookup  *lookup,
 void
 _gtk_css_lookup_resolve (GtkCssLookup            *lookup,
                          GtkStyleProviderPrivate *provider,
+                        int                      scale,
                          GtkCssComputedValues    *values,
                          GtkCssComputedValues    *parent_values)
 {
@@ -164,6 +165,7 @@ _gtk_css_lookup_resolve (GtkCssLookup            *lookup,
                _gtk_bitmask_get (lookup->missing, i))
         _gtk_css_computed_values_compute_value (values,
                                                 provider,
+                                               scale,
                                                 parent_values,
                                                 i,
                                                 lookup->values[i].value,
diff --git a/gtk/gtkcsslookupprivate.h b/gtk/gtkcsslookupprivate.h
index 8e80097..9287ccb 100644
--- a/gtk/gtkcsslookupprivate.h
+++ b/gtk/gtkcsslookupprivate.h
@@ -55,6 +55,7 @@ void                    _gtk_css_lookup_set_computed            (GtkCssLookup
                                                                  GtkCssValue                *value);
 void                    _gtk_css_lookup_resolve                 (GtkCssLookup               *lookup,
                                                                  GtkStyleProviderPrivate    *provider,
+                                                                int                         scale,
                                                                  GtkCssComputedValues       *values,
                                                                  GtkCssComputedValues       *parent_values);
 
diff --git a/gtk/gtkcssnumbervalue.c b/gtk/gtkcssnumbervalue.c
index ed2bfe5..a66dc09 100644
--- a/gtk/gtkcssnumbervalue.c
+++ b/gtk/gtkcssnumbervalue.c
@@ -59,6 +59,7 @@ static GtkCssValue *
 gtk_css_value_number_compute (GtkCssValue             *number,
                               guint                    property_id,
                               GtkStyleProviderPrivate *provider,
+                             int                      scale,
                               GtkCssComputedValues    *values,
                               GtkCssComputedValues    *parent_values,
                               GtkCssDependencies      *dependencies)
diff --git a/gtk/gtkcsspositionvalue.c b/gtk/gtkcsspositionvalue.c
index 8f09db7..dd9e0ad 100644
--- a/gtk/gtkcsspositionvalue.c
+++ b/gtk/gtkcsspositionvalue.c
@@ -40,6 +40,7 @@ static GtkCssValue *
 gtk_css_value_position_compute (GtkCssValue             *position,
                                 guint                    property_id,
                                 GtkStyleProviderPrivate *provider,
+                               int                      scale,
                                 GtkCssComputedValues    *values,
                                 GtkCssComputedValues    *parent_values,
                                 GtkCssDependencies      *dependencies)
@@ -47,8 +48,8 @@ gtk_css_value_position_compute (GtkCssValue             *position,
   GtkCssValue *x, *y;
   GtkCssDependencies x_deps, y_deps;
 
-  x = _gtk_css_value_compute (position->x, property_id, provider, values, parent_values, &x_deps);
-  y = _gtk_css_value_compute (position->y, property_id, provider, values, parent_values, &y_deps);
+  x = _gtk_css_value_compute (position->x, property_id, provider, scale, values, parent_values, &x_deps);
+  y = _gtk_css_value_compute (position->y, property_id, provider, scale, values, parent_values, &y_deps);
   *dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
   if (x == position->x && y == position->y)
     {
diff --git a/gtk/gtkcssrepeatvalue.c b/gtk/gtkcssrepeatvalue.c
index eda6fef..5ecaaca 100644
--- a/gtk/gtkcssrepeatvalue.c
+++ b/gtk/gtkcssrepeatvalue.c
@@ -37,6 +37,7 @@ static GtkCssValue *
 gtk_css_value_repeat_compute (GtkCssValue             *value,
                               guint                    property_id,
                               GtkStyleProviderPrivate *provider,
+                             int                      scale,
                               GtkCssComputedValues    *values,
                               GtkCssComputedValues    *parent_values,
                               GtkCssDependencies      *dependencies)
diff --git a/gtk/gtkcssrgbavalue.c b/gtk/gtkcssrgbavalue.c
index fb52ace..c58534a 100644
--- a/gtk/gtkcssrgbavalue.c
+++ b/gtk/gtkcssrgbavalue.c
@@ -37,6 +37,7 @@ static GtkCssValue *
 gtk_css_value_rgba_compute (GtkCssValue             *value,
                             guint                    property_id,
                             GtkStyleProviderPrivate *provider,
+                           int                      scale,
                             GtkCssComputedValues    *values,
                             GtkCssComputedValues    *parent_values,
                             GtkCssDependencies      *dependencies)
diff --git a/gtk/gtkcssshadowsvalue.c b/gtk/gtkcssshadowsvalue.c
index 3249491..b688594 100644
--- a/gtk/gtkcssshadowsvalue.c
+++ b/gtk/gtkcssshadowsvalue.c
@@ -51,6 +51,7 @@ static GtkCssValue *
 gtk_css_value_shadows_compute (GtkCssValue             *value,
                                guint                    property_id,
                                GtkStyleProviderPrivate *provider,
+                              int                      scale,
                                GtkCssComputedValues    *values,
                                GtkCssComputedValues    *parent_values,
                                GtkCssDependencies      *dependencies)
@@ -65,7 +66,7 @@ gtk_css_value_shadows_compute (GtkCssValue             *value,
   result = gtk_css_shadows_value_new (value->values, value->len);
   for (i = 0; i < value->len; i++)
     {
-      result->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, values, 
parent_values, &child_deps);
+      result->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, scale, values, 
parent_values, &child_deps);
       *dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
     }
 
diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c
index 413d000..de34599 100644
--- a/gtk/gtkcssshadowvalue.c
+++ b/gtk/gtkcssshadowvalue.c
@@ -70,6 +70,7 @@ static GtkCssValue *
 gtk_css_value_shadow_compute (GtkCssValue             *shadow,
                               guint                    property_id,
                               GtkStyleProviderPrivate *provider,
+                             int                      scale,
                               GtkCssComputedValues    *values,
                               GtkCssComputedValues    *parent_values,
                               GtkCssDependencies      *dependencies)
@@ -78,23 +79,23 @@ gtk_css_value_shadow_compute (GtkCssValue             *shadow,
   GtkCssDependencies child_deps;
 
   child_deps = 0;
-  hoffset = _gtk_css_value_compute (shadow->hoffset, property_id, provider, values, parent_values, 
&child_deps);
+  hoffset = _gtk_css_value_compute (shadow->hoffset, property_id, provider, scale, values, parent_values, 
&child_deps);
   *dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
 
   child_deps = 0;
-  voffset = _gtk_css_value_compute (shadow->voffset, property_id, provider, values, parent_values, 
&child_deps);
+  voffset = _gtk_css_value_compute (shadow->voffset, property_id, provider, scale, values, parent_values, 
&child_deps);
   *dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
 
   child_deps = 0;
-  radius = _gtk_css_value_compute (shadow->radius, property_id, provider, values, parent_values, 
&child_deps);
+  radius = _gtk_css_value_compute (shadow->radius, property_id, provider, scale, values, parent_values, 
&child_deps);
   *dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
 
   child_deps = 0;
-  spread = _gtk_css_value_compute (shadow->spread, property_id, provider, values, parent_values, 
&child_deps),
+  spread = _gtk_css_value_compute (shadow->spread, property_id, provider, scale, values, parent_values, 
&child_deps),
   *dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
 
   child_deps = 0;
-  color = _gtk_css_value_compute (shadow->color, property_id, provider, values, parent_values, &child_deps);
+  color = _gtk_css_value_compute (shadow->color, property_id, provider, scale, values, parent_values, 
&child_deps);
   *dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
 
   return gtk_css_shadow_value_new (hoffset, voffset, radius, spread, shadow->inset, color);
diff --git a/gtk/gtkcssstringvalue.c b/gtk/gtkcssstringvalue.c
index 82e7c37..f97b512 100644
--- a/gtk/gtkcssstringvalue.c
+++ b/gtk/gtkcssstringvalue.c
@@ -37,6 +37,7 @@ static GtkCssValue *
 gtk_css_value_string_compute (GtkCssValue             *value,
                               guint                    property_id,
                               GtkStyleProviderPrivate *provider,
+                             int                      scale,
                               GtkCssComputedValues    *values,
                               GtkCssComputedValues    *parent_values,
                               GtkCssDependencies      *dependencies)
diff --git a/gtk/gtkcsstypedvalue.c b/gtk/gtkcsstypedvalue.c
index aecee31..5471618 100644
--- a/gtk/gtkcsstypedvalue.c
+++ b/gtk/gtkcsstypedvalue.c
@@ -38,6 +38,7 @@ static GtkCssValue *
 gtk_css_value_typed_compute (GtkCssValue             *value,
                              guint                    property_id,
                              GtkStyleProviderPrivate *provider,
+                            int                      scale,
                              GtkCssComputedValues    *values,
                              GtkCssComputedValues    *parent_values,
                              GtkCssDependencies      *dependencies)
diff --git a/gtk/gtkcssvalue.c b/gtk/gtkcssvalue.c
index 6d77cf8..8ee780d 100644
--- a/gtk/gtkcssvalue.c
+++ b/gtk/gtkcssvalue.c
@@ -88,6 +88,7 @@ GtkCssValue *
 _gtk_css_value_compute (GtkCssValue             *value,
                         guint                    property_id,
                         GtkStyleProviderPrivate *provider,
+                       int                      scale,
                         GtkCssComputedValues    *values,
                         GtkCssComputedValues    *parent_values,
                         GtkCssDependencies      *dependencies)
@@ -103,7 +104,7 @@ _gtk_css_value_compute (GtkCssValue             *value,
     dependencies = &fallback;
   *dependencies = 0;
 
-  return value->class->compute (value, property_id, provider, values, parent_values, dependencies);
+  return value->class->compute (value, property_id, provider, scale, values, parent_values, dependencies);
 }
 
 gboolean
diff --git a/gtk/gtkcssvalueprivate.h b/gtk/gtkcssvalueprivate.h
index 1d2424e..9871ab3 100644
--- a/gtk/gtkcssvalueprivate.h
+++ b/gtk/gtkcssvalueprivate.h
@@ -43,6 +43,7 @@ struct _GtkCssValueClass {
   GtkCssValue * (* compute)                           (GtkCssValue                *value,
                                                        guint                       property_id,
                                                        GtkStyleProviderPrivate    *provider,
+                                                      int                         scale,
                                                        GtkCssComputedValues       *values,
                                                        GtkCssComputedValues       *parent_values,
                                                        GtkCssDependencies         *dependencies);
@@ -68,6 +69,7 @@ void         _gtk_css_value_unref                     (GtkCssValue
 GtkCssValue *_gtk_css_value_compute                   (GtkCssValue                *value,
                                                        guint                       property_id,
                                                        GtkStyleProviderPrivate    *provider,
+                                                      int                         scale,
                                                        GtkCssComputedValues       *values,
                                                        GtkCssComputedValues       *parent_values,
                                                        GtkCssDependencies         *dependencies);
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 076942a..0bb4fed 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -3295,6 +3295,7 @@ _gtk_style_context_validate (GtkStyleContext  *context,
                                                   priv->parent ? style_data_lookup (priv->parent)->store : 
NULL,
                                                   timestamp,
                                                   GTK_STYLE_PROVIDER_PRIVATE (priv->cascade),
+                                                 priv->scale,
                                                   current && gtk_style_context_should_create_transitions 
(context) ? current->store : NULL);
       if (_gtk_css_computed_values_is_static (data->store))
         change &= ~GTK_CSS_CHANGE_ANIMATE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]