Commit Graph

17 Commits

Author SHA1 Message Date
Benjamin Otte
6fbd8b0003 computedvalues: Pass dependencies to set_value()
This simplifies the code.
2012-08-28 15:42:24 +02:00
Benjamin Otte
9b228c59d5 cssomputedvalues: Track dependencies
We now track what values have dependencies on what other values so that
we could in theory recompute them when we need to.
2012-08-28 15:42:23 +02:00
Benjamin Otte
0e2f35ed88 css: Introduce dependencies for value computations
When values are computed, they might depend on various other values and
we need to track this so we can update the values when those other
values change. This is the first step in making that happen.

This patch does not do any dependency tracking at all, instead it uses
GTK_CSS_DEPENDS_ON_EVERYTHING as a sort of FIXME.
2012-08-28 15:42:23 +02:00
Benjamin Otte
9e7e65ca6e css: Move computing of initial and inherit values
... to the compute vfunc. Simplifies code quite a bit. But makes the
code no longer a simple step-by-step implementation of the spec.
2012-08-28 15:40:57 +02:00
Benjamin Otte
6dc3113edc cssstyleproperty: Get rid of unused API
Both _gtk_css_style_property_print_value() and
_gtk_css_style_property_compute_value() aren't necessary anymore and are
replaced by _gtk_css_value_print() and _gtk_css_value_comptue()
respectively.
2012-08-28 15:40:57 +02:00
Benjamin Otte
50fdb6a13f computedvalues: Split out a function 2012-04-17 08:59:22 +02:00
Benjamin Otte
aaedc7b67f stylecontext: Compute if things changed before invalidating
This is only a small performance boost by itself, but it's necessary
for animations, so we need it.

Benchmark numbers for my Glade benchmark for interested people:
        GTK 3.4.0    last commit  this commit
Raleigh
  real  0m41.879s    0m10.176s    0m9.900s
  user  0m41.394s    0m9.895s     0m9.628s
  sys   0m0.111s     0m0.096s     0m0.102s

Adwaita                                        (*)
  real  0m51.049s    0m13.432s    0m14.848s    0m12.253s
  user  0m50.487s    0m13.034s    0m13.218s    0m11.927s
  sys   0m0.117s     0m0.151s     0m0.147s     0m0.107s

Ambiance (patched to not use private GTK APIs)
  real  0m52.167s    0m13.115s    0m13.117s    0m12.944s
  user  0m51.576s    0m12.739s    0m12.768s    0m12.651s
  sys   0m0.119s     0m0.137s     0m0.136s     0m0.118s

(*) Adwaita and unico currently use custom properties, and
_gtk_css_value_compare() for custom properties always returns FALSE,
which makes this optimization never trigger. So I modified
_gtk_css_value_compare() to return TRUE for these properties instead and
reran the benchmark. Those are the numbers.
2012-04-17 08:59:21 +02:00
Benjamin Otte
68b7d3e410 computedvalues: Fix signage error 2012-04-17 08:59:16 +02:00
Benjamin Otte
a360e77a7b css: Remove _gtk_css_computed_values_get_value_by_name()
Now that we use an enum for the IDs, we don't need that function
anymore.
2012-04-17 08:59:16 +02:00
Benjamin Otte
31565139ba stylecontext: Convert _gtk_style_context_peek_property()
Take the property id instead of the name.
2012-04-17 08:59:15 +02:00
Benjamin Otte
9b7640b898 styleproperty: Make _gtk_style_property_parse_value() return a CssValue
Also split out initial/inherit handling into a custom GtkCssValue class.
2012-04-17 08:59:11 +02:00
Benjamin Otte
7a7e2ed92b csscomputedvalues: Unref old value when setting new one 2012-04-07 13:01:25 +02:00
Alexander Larsson
7603e6e473 css: Use GtkCssValues instead of GValue in the css machinery
Also, in places where we're computing a new CssValue based on an
old one, make sure that if nothing changes we're returning a reference
to the old one, rather than creating a new identical instance.
2012-03-08 11:03:57 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Benjamin Otte
6ba33e7af5 css: Allow bypassing the compute_value() stage
This is useful when overriding values.
2012-02-02 03:13:38 +01:00
Benjamin Otte
fd4f701c50 css: Use GArray in GtkCssComputedValues
GValueArray is deprecated in glib. Also, bump the required glib version
for g_array_set_clear_func().
2012-01-25 19:05:33 +01:00
Benjamin Otte
6962b49a99 css: Introduce GtkCssComputedValues
To be used for storing computed values. Is the replacement for
GtkStyleProperties, which is now legacy code.
2012-01-11 15:48:54 +01:00