Commit Graph

26 Commits

Author SHA1 Message Date
Timm Bäder
191e3bc7e1 csslookup: Remove 'relevant' parameter from _init
Unused.
2019-09-09 17:36:24 +02:00
Timm Bäder
f3fdf58ff7 cssstaticstyle: Avoid ref'ing specified value in compute_value
There are alerady _get functions for GtkCssInheritValue and
GtkCssInitialValue, so use those. We can avoid a ref+unref pair this
way.
2019-09-09 17:36:24 +02:00
Timm Bäder
6ed6cc46de cssstaticstyle: Make set_value (transfer-full)
We only call this in one place and we can avoid a ref + unref pair this
way.
2019-09-09 17:36:23 +02:00
Timm Bäder
6837e80d14 css: Avoid more type checks in hot paths 2019-09-09 17:36:23 +02:00
Benjamin Otte
04d24b7cd2 csssection: Make printing functions public 2019-04-12 19:34:28 +02:00
Timm Bäder
df1f036a95 cssanimatedstyle: Avoid some type checks and unnecessary work 2019-01-29 05:03:26 +01:00
Timm Bäder
355b883f32 stack-allocate GtkCssLookup instances 2018-01-02 08:36:10 +01:00
Matthias Clasen
a8531605db Some more interning
This avoids more strdups at startup.
2017-11-18 08:18:11 -05:00
Benjamin Otte
e8053622eb gtk: Fix debug build
It seems I didn't have debug builds enabled and forgot some
return_if_fail()s when doing the last patch.
2017-10-31 06:10:26 +01:00
Benjamin Otte
83fb7a649f css: Merge GtkStyleProviderPrivate into GtkStyleProvider
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.
2017-10-31 04:33:54 +01:00
Alexander Larsson
882290b479 Skip dynamic type check in css value getters
This gets called a lot during snapshotting, and this change
alone brings down snapshot time by almost 10% in a syntethic
snapshot test.
2017-01-11 09:20:30 +01:00
Matthias Clasen
9133ec5cd4 Remove an unnecessary check
Since the demise of theme engines, we can no longer hit
the case of id >= GTK_CSS_PROPERTY_N_PROPERTIES. So don't
check for this in a very frequently called function.
2017-01-10 19:56:21 -05:00
Matthias Clasen
9fac83783c Don't use qdata for getting the default css style
There's no point in using qdata for looking this up, since
we only ever set it on the default screen anyway.
2016-05-06 10:14:07 -04:00
Benjamin Otte
d75989a52b cssstyle: Don't store custom css properties
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
2015-11-20 21:22:15 +01:00
Matthias Clasen
7cd7257a07 Avoid a string copy
We have an api to create a quark from a static string, lets use it.
2015-09-07 11:36:36 -04:00
Benjamin Otte
da25771e58 cssvalue: Remove GtkCssDependencies
They are not used anymore.
2015-03-18 15:23:31 +01:00
Benjamin Otte
e95985da26 cssstyle: Remove unused optimization
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.
2015-03-18 15:23:31 +01:00
Benjamin Otte
1116914ea0 css: Move scale to GtkStyleProviderPrivate
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.
2015-02-06 11:26:31 +01:00
Benjamin Otte
7281419341 css: Having a static style per screen isn't useful
Just have one static style for everything.
2015-02-04 18:36:10 +01:00
Benjamin Otte
27285f1f0f cssstyle: Have a default style
This way we can initialize the default style info with a style and
ddon't need to special case NULL everywhere.
2015-01-07 14:26:48 +01:00
Benjamin Otte
730f429168 cssstaticstyle: Handle relevant change
Relevant change is returned from style lookups, so keep is with the
object that holds those values.
2015-01-07 14:26:48 +01:00
Benjamin Otte
9645daf48f cssstyle: Move function from vfunc to static func
compute_dependencies() is only used internally by GtkCssStaticStyle,
so there's no need to have it elsewhere.
2015-01-07 14:26:47 +01:00
Benjamin Otte
cd056adb2f cssstaticstyle: Move function
And with that move, GtkCssStaticStyle is immutable.
2015-01-07 14:26:47 +01:00
Benjamin Otte
8b823d7e13 cssstaticstyle: Move function
We want the new() return values to be immutable, so we have to move the
code that modifes them.
2015-01-07 14:26:47 +01:00
Benjamin Otte
b7be202089 stylecontext: Refactor update_properties()
It now always returns a new instance.
2015-01-07 14:26:47 +01:00
Benjamin Otte
ac215ffc8f cssstyle: Add GtkCssStaticStyle
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.
2015-01-07 14:26:47 +01:00