summaryrefslogtreecommitdiff
path: root/gtk/gtkcssstaticstyleprivate.h
Commit message (Collapse)AuthorAgeFilesLines
* css: Split styles into groupsMatthias Clasen2020-01-291-9/+1
| | | | | | | | Introduce refcounted structs for groups of related css properties, and use them to store the style values. Both GtkCssStaticStyle and GtkCssAnimatedStyle fill in the structs in GtkCssStyle, and we can avoid vfuncs for value access, which should be much faster. We can even start accessing style->core->color directly.
* css: Add fast-path for parent selector matchingBenjamin Otte2020-01-281-12/+15
| | | | | | | | | | | | | Add a fast path for parent selector matching that uses a bloom filter to quickly discard selectors that can't possibly match. Keep in mind that we match using a bloom filter, so we might accidentally include too many selectors when hash/bucket collisions occur. That's not a correctness problem though, because we'll do a real check afterwards. The idea for this change is taken from browsers, in particular WebKit.
* css: Pass node through the lookup codeBenjamin Otte2020-01-281-3/+1
| | | | | | ... instead of passing a matcher. The matcher code is now local to the CssProvider/CssSelector machinery.
* Revert "css: Split style into groups"Matthias Clasen2020-01-251-154/+1
| | | | This reverts commit 0df0de0b5db87248ad1371ee1bfc8a733ec079e4.
* css: Split style into groupsMatthias Clasen2020-01-251-1/+154
|
* css: Avoid computing change too oftenMatthias Clasen2020-01-161-1/+2
| | | | | | | | | | | Most of the time when styles need to be recreated, the name and classes of the css node haven't changed. In this case, the change value will not change either, since we are computing change under the assumption that name and classes are unchanged. So don't recompute the change. This avoids the second match we do to find the superset, cutting down the number of times we consult the selector tree.
* Change the signature of gtk_css_style_get_static_styleMatthias Clasen2020-01-161-1/+0
| | | | It is clearer if this function returns a GtkCssStaticStyle.
* css: Merge GtkStyleProviderPrivate into GtkStyleProviderBenjamin Otte2017-10-311-2/+2
| | | | | | | | This is just lots of renaming. The interface remains private, so the public API does not change, apart from removing the definition of the Interface object to avoid subclassing.
* cssstyle: Don't store custom css propertiesBenjamin Otte2015-11-201-1/+1
| | | | | | | | | This makes custom CSS properties no longer configurable. But it avoids crashes when loading custom themes, so that's a good thing. Testcase included. https://bugzilla.redhat.com/show_bug.cgi?id=1281234
* cssstyle: Remove unused optimizationBenjamin Otte2015-03-181-10/+0
| | | | | | After measuring it, I realized the optimization never triggers for Adwaita and rarely ever triggers for simple themes. So it is not useful to keep it around.
* css: Move scale to GtkStyleProviderPrivatewip/mir2Benjamin Otte2015-02-061-3/+0
| | | | | | This way, we can remove it as a separate argument from gtk_css_value_compute() and allow computation to only depend on one thing: the style provider.
* css: Having a static style per screen isn't usefulBenjamin Otte2015-02-041-1/+1
| | | | Just have one static style for everything.
* cssstyle: Have a default styleBenjamin Otte2015-01-071-0/+1
| | | | | This way we can initialize the default style info with a style and ddon't need to special case NULL everywhere.
* cssstaticstyle: Handle relevant changeBenjamin Otte2015-01-071-2/+5
| | | | | Relevant change is returned from style lookups, so keep is with the object that holds those values.
* cssstaticstyle: Move functionBenjamin Otte2015-01-071-2/+6
| | | | And with that move, GtkCssStaticStyle is immutable.
* cssstaticstyle: Move functionBenjamin Otte2015-01-071-1/+6
| | | | | We want the new() return values to be immutable, so we have to move the code that modifes them.
* stylecontext: Refactor update_properties()Benjamin Otte2015-01-071-0/+2
| | | | It now always returns a new instance.
* cssstyle: Add GtkCssStaticStyleBenjamin Otte2015-01-071-0/+69
For now, this is only an implementation detail of the animated style. The idea is to use GtkCssStaticStyle as the result of CSS queries and then put a GtkCssAnimatedStyle on top that manages the animations. The neat thing about this is that you can cache the static values.