Commit Graph

14 Commits

Author SHA1 Message Date
Matthias Clasen
ef8e8ba14d css: Give none singletons unique names
This makes for a less confusing experience in gdb.
2020-04-18 15:24:13 -04:00
Timm Bäder
24d8c0a7dc css: Set the is_computed flag for more values
With these changes, we skip roughly 85% of compute() calls during
widget-factory startup
2020-01-18 08:49:51 +01:00
Timm Bäder
31aa5a0e53 cssvalue: Add is_computed flag
When a css value has "child" css values (e.g. a linear gradient has
several color stop css values) which are all computed (won't change when
compute() is called on them), we want to skip computing the entire
subtree.

Since css values are immutable, we can set the is_computed flag at
construct time.

Since GtkCssValue instances are 0-initialized in _gtk_css_value_alloc,
the default for is_computed it FALSE. This commit only sets it to TRUE
in a few cases, such as various "none" singleton values which will never
change. Later commits will refine this and set it for more values.
2020-01-18 08:49:51 +01:00
Timm Bäder
1200fe2daf cssvalue: Add type names for all classes
This is important to have for debugging and e.g. to print statistics for
the individual css value types
2020-01-18 08:49:51 +01:00
Benjamin Otte
1cd9396154 css: Review error messages
... and move them from _gtk_css_parser_error() to the proper new error
message.
2019-04-12 19:34:28 +02:00
Benjamin Otte
38227dc972 cssfiltervalue: Use gtk_css_parser_consume_function() 2019-04-12 19:34:28 +02:00
Benjamin Otte
684b6459f1 cssparser: Get rid of _gtk_css_parser_begins_with()
Replace it with calls to gtk_css_parser_has_token().
2019-04-12 19:34:28 +02:00
Benjamin Otte
73b4a62f51 snapshot: Redo debug messages
Instead of every snapshot function having debug messages, have an
explicit gtk_snapshot_push_debug() function that appends a debug node.
2018-04-24 04:06:58 +02:00
Benjamin Otte
3322599e99 css: Introduce the idea of dynamic values
Dynamic values are values that change their contents with the current
(monotonic) time.

This just introduces the GtkCssValue API for it.
2018-03-16 06:04:43 +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
Matthias Clasen
86c60592fb css: Implement the blur filter
This implementation is somewhat incomplete, since
we don't allow combining blur with the other filters
yet.
2017-09-04 14:28:16 -04:00
Benjamin Otte
b58de2d16c snapshot: Redo pop() API
gtk_snapshot_pop() => removed
gtk_snapshot_pop_and_append() => gtk_snapshot_pop()

So now there is no way to get a rendernode out of the snapshotting API
until you gtk_snapshot_finish().
2017-01-13 03:38:36 +01:00
Benjamin Otte
fb43807fbb cssfiltervalue: Change node name
We're not just using this for icon filters, but for regular filters, so
the existing name is confusing.
2016-12-31 14:37:20 +01:00
Benjamin Otte
2645b5a7d7 gtk: Implement -gtk-icon-filter
This uses the new GskColorMatrixNode to implement a filter that applies
to icons. It's meant to replace -gtk-icon-effect.
2016-12-31 02:49:47 +01:00