Timm Bäder [Wed, 29 Jan 2020 07:49:13 +0000 (07:49 +0000)]
Merge branch 'fix-doc-typo' into 'master'
Fix a doc typo
See merge request GNOME/gtk!1364
Benjamin Otte [Wed, 29 Jan 2020 04:35:56 +0000 (04:35 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master
See merge request GNOME/gtk!1365
Benjamin Otte [Wed, 29 Jan 2020 03:20:47 +0000 (04:20 +0100)]
cssselector: Rework how we handle the bloom filter
Instead of foreaching through all the previous selectors every time we
bloom-filter, just bloom-filter the current element and return a special
value if that filter fails (FALSE). If that happens, don't try
filter-matching more nodes in the caller as we know it's an abort.
Luca Bacci [Tue, 28 Jan 2020 20:42:03 +0000 (20:42 +0000)]
Fix a doc typo
Benjamin Otte [Tue, 28 Jan 2020 17:28:32 +0000 (18:28 +0100)]
cssselector: Reorder functions
This just changes the order of functions in the source code in
preparation for the next commit.
Benjamin Otte [Tue, 28 Jan 2020 16:49:37 +0000 (17:49 +0100)]
css: Don't do the "all set" test
We have so many properties that it is basically impossible that all of
them are set and the time spent checking is higher than the time saved
if it does indeed happen.
Benjamin Otte [Tue, 28 Jan 2020 16:43:33 +0000 (16:43 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
popover: Do not validate the css node on show()
See merge request GNOME/gtk!1363
Benjamin Otte [Tue, 28 Jan 2020 16:15:04 +0000 (17:15 +0100)]
popover: Do not validate the css node on show()
This was a good idea back in GTK3 when popovers were toplevels, but now
they're regular child widgets, so they should behave that way.
Also, with the introduction of the bloom filter, gtk_css_node_validate()
now assumes it's only called on root nodes, so assert that that is the
case.
Benjamin Otte [Tue, 28 Jan 2020 03:56:49 +0000 (03:56 +0000)]
Merge branch 'wip/otte/css' into 'master'
selector: Rework iterating over subnodes
See merge request GNOME/gtk!1361
Benjamin Otte [Tue, 28 Jan 2020 02:53:48 +0000 (03:53 +0100)]
selector: Rework iterating over subnodes
Instead of a foreach() function, introduce an iterator, so that the
caller can drive the iteration.
This allows doing stuff inbetween callbacks and avoids closures when
more than one data object should be passed.
As a side effect I even get a small, but noticeable performance
improvement in the 2-10% range depending on benchmark, I guess that's
because there's no function pointer passing going on anymore.
Benjamin Otte [Tue, 28 Jan 2020 02:47:25 +0000 (02:47 +0000)]
Merge branch 'wip/otte/css' into 'master'
CSS improvements
See merge request GNOME/gtk!1360
Benjamin Otte [Mon, 27 Jan 2020 23:46:43 +0000 (00:46 +0100)]
styleproperty: Remove ability to query properties
With gtk_style_context_get() gone, this is no longer used.
Benjamin Otte [Mon, 27 Jan 2020 23:27:36 +0000 (00:27 +0100)]
stylecontext: Get rid of gtk_style_context_get()
... and replace all the calls to it with
gtk_style_context_peek_property().
All the calls are hacks that need to go away btw.
Benjamin Otte [Mon, 27 Jan 2020 22:04:15 +0000 (23:04 +0100)]
testcalendar: Don't do dumb stuff with font sizes.
If you want to test font stuff, it's 2020 and we have an inspector.
Benjamin Otte [Mon, 27 Jan 2020 21:58:15 +0000 (22:58 +0100)]
filechooser: Remove default size machinery
The FileChooser ToolKit (fctk) had its own machinery to handle default
sizes which was completely busted and trying to marshal random numbers
through the widget hierarchy that maybe made sense in 2012 but don't do
now.
Get rid of it, just keep the dialog's GSetting - which funnily enough
used to be written by the dialog but written by the widget.
But that's fctk for you.
Benjamin Otte [Mon, 27 Jan 2020 16:13:04 +0000 (17:13 +0100)]
cellrenderertoggle: size based on -gtk-icon-size
Instead of hardcoding 16px.
Benjamin Otte [Mon, 27 Jan 2020 15:13:25 +0000 (16:13 +0100)]
stylecontext: Remove gtk_style_context_get_section()
The inspectors gets values differently these days.
Benjamin Otte [Mon, 27 Jan 2020 14:07:37 +0000 (15:07 +0100)]
stylecontext: Remove GTK_STYLE_PROPERTY_* defines
They shouldn't be (and aren't) used anymore.
Benjamin Otte [Mon, 27 Jan 2020 02:26:39 +0000 (03:26 +0100)]
css: Use the bloom filter for change matching
Instead of just doing radical change matching on the node itself, also
consider the parent nodes via the bloom filter.
This means a radical change is now also one where the parent
name/id/classes change, but since that's considered a radical change on
the parent already, those things are slow anyway.
Improves the benchmark times for CSS validation during backdrop
transitions in widget-factory from 45ms to 35ms on my machine.
Benjamin Otte [Mon, 27 Jan 2020 01:49:36 +0000 (02:49 +0100)]
selector: Make :not() selectors not radical
:not() selectors cannot be radical because the bloomfilter only knows if
a value is set in any of the nodes, but cannot determine the opposite
(if a value is not set in at least one node), but that would be required
for:not() selectors.
However, this is very unlikely to happen in the real world, so it's not
worth optimizing.
Unfortunately, change tracking could know this, so by excluding the
:not() selectors from radical changes, the change tracking will now pick
them up. If that turns out to be a performance problem, we need to add a
special category for radical not filters, so change tracking and bloom
filters can deal with them.
The testcase demonstrating the problem in widget-factory has been
extrated and added.
Benjamin Otte [Mon, 27 Jan 2020 01:15:06 +0000 (02:15 +0100)]
testsuite: Improve diff_with_file() function
Properly handle diff(1) failing.
In this particular case, the test passed a NULL input file to the diff
(that was fixed, too) and then diff only found one input file and
aborted.
But without this fix, we'd also not catch other abortion reasons for
diff() - as long as it exited in any way, we were happy.
Benjamin Otte [Sun, 26 Jan 2020 03:37:17 +0000 (04:37 +0100)]
css: Add fast-path for parent selector matching
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.
Benjamin Otte [Sun, 26 Jan 2020 03:17:17 +0000 (04:17 +0100)]
cssnodedeclaration: C99-ify the code
zero-sized arrays are allowed now.
Benjamin Otte [Fri, 24 Jan 2020 16:56:53 +0000 (17:56 +0100)]
selector: Hash differently
This will be relevant for a bloom filter. And bloom filters want 12bit
hashes, so we try to produce hash values < 4096.
Benjamin Otte [Thu, 23 Jan 2020 23:43:26 +0000 (00:43 +0100)]
cssnode: Convert name + id from interned string to GQuark
The reason for this is simply that I want to get hash functions that
have their values close together, so they can fit in a smaller range
(the goal here is 12 bits). By using GQuark, we get consecutive numbers
starting with 1 (and applications have <1000 quarks usually), whereas
interned strings can be all over the place.
As a side effect we also save 64 bytes per declaration.
Benjamin Otte [Thu, 23 Jan 2020 02:34:25 +0000 (03:34 +0100)]
css: Get rid of GtkCssMatcher
Benjamin Otte [Thu, 23 Jan 2020 01:42:01 +0000 (02:42 +0100)]
css: Pass node through the lookup code
... instead of passing a matcher.
The matcher code is now local to the CssProvider/CssSelector machinery.
Benjamin Otte [Thu, 23 Jan 2020 01:28:46 +0000 (02:28 +0100)]
cssnode: Remove init_matcher() vfunc
It's unused.
Benjamin Otte [Thu, 23 Jan 2020 01:22:30 +0000 (02:22 +0100)]
cssnode: Remove ability to set GType as fallback name
Benjamin Otte [Wed, 22 Jan 2020 23:45:27 +0000 (00:45 +0100)]
Remove GtkWidgetPath
... and all associated demos and tests.
Benjamin Otte [Wed, 22 Jan 2020 23:45:01 +0000 (00:45 +0100)]
Remove gtkwidgetpath.h include where no longer needed
Benjamin Otte [Wed, 22 Jan 2020 21:49:27 +0000 (22:49 +0100)]
Revert "cssmatcher: Inline node values into matcher"
This reverts commit
a75529f3c00736856fa20f19e920614be5a48fbb.
It just complicates code and there are no performance numbers that would
warrant such a commit.
Benjamin Otte [Mon, 27 Jan 2020 02:44:05 +0000 (03:44 +0100)]
css: Move utility function
The function was not selector-specific, so putting it with all the other
utility functions makes more sense.
Also use the utility function in the node declaration printing.
Matthias Clasen [Mon, 27 Jan 2020 14:35:09 +0000 (09:35 -0500)]
textutil: Stop using GtkStyleContext
We can just use the css style directly.
Matthias Clasen [Mon, 27 Jan 2020 18:34:21 +0000 (13:34 -0500)]
gskpango: Don't free rgba's we don't own
We don't copy them anymore, so don't free them.
Matthias Clasen [Mon, 27 Jan 2020 14:10:47 +0000 (09:10 -0500)]
filechooser: Stop using gtk_style_context_get
Just go to the css style directly.
Rafael Fontenelle [Mon, 27 Jan 2020 17:09:32 +0000 (17:09 +0000)]
Update Brazilian Portuguese translation
Timm Bäder [Mon, 27 Jan 2020 12:01:37 +0000 (13:01 +0100)]
popover: Fix an oversight in gap coord computation
This caused a border to show up between the popover arrow and the
contents.
Timm Bäder [Mon, 27 Jan 2020 09:28:42 +0000 (10:28 +0100)]
calendar: Use widgets for the header
This is not meant to be a full GtkCalendar conversion to use widgets
instead of custom drawing, but we lost the arrows in the calendar header
when builtin icons were removed. Using proper button for the year/month
buttons brings them back.
Umarzuki Bin Mochlis Moktar [Mon, 27 Jan 2020 12:25:12 +0000 (12:25 +0000)]
Update Malay translation
Umarzuki Bin Mochlis Moktar [Mon, 27 Jan 2020 12:22:47 +0000 (12:22 +0000)]
Update Malay translation
Fabio Tomat [Mon, 27 Jan 2020 08:56:42 +0000 (08:56 +0000)]
Update Friulian translation
Dušan Kazik [Mon, 27 Jan 2020 07:01:51 +0000 (07:01 +0000)]
Update Slovak translation
Matthias Clasen [Mon, 27 Jan 2020 01:16:16 +0000 (20:16 -0500)]
css: Don't lose inset when computing shadows
This was showing up as reftest failures,
sporadically
Timm Bäder [Sun, 26 Jan 2020 16:39:26 +0000 (17:39 +0100)]
gsk: Remove some unused defines
These are from the GVariant days of render nodes.
Timm Bäder [Sat, 25 Jan 2020 18:59:12 +0000 (19:59 +0100)]
cssdimensionvalue: Remove an outdated comment
It's actually implemented in gtkcssdimensionvalue.c these days.
Timm Bäder [Sat, 25 Jan 2020 18:40:54 +0000 (19:40 +0100)]
cssboxes: Try to avoid doing work for rectangular boxes
Use the new gtk_css_dimension_value_is_zero() to check if we really need
to e.g. apply a border radius at all.
We compute css boxes a lot so this makes sense here, it especially shows
up during pick(), where we need the border box.
Timm Bäder [Sat, 25 Jan 2020 18:40:13 +0000 (19:40 +0100)]
dimensionvalue: Add gtk_css_{dimension,corner}_value_is_zero()
We can usually omit computations when the dimension value ends up being
zero anyway.
Timm Bäder [Sat, 25 Jan 2020 18:39:28 +0000 (19:39 +0100)]
widget: Restructure pick() a bit
Don't even invert transforms if we can do it easily ourselves. This also
fixes a small GtkTransform memory leak.
Timm Bäder [Sat, 25 Jan 2020 15:21:00 +0000 (16:21 +0100)]
renderbackground: Avoid unnecessary work in snapshot_background()
Timm Bäder [Fri, 24 Jan 2020 12:17:09 +0000 (13:17 +0100)]
Add pure and const annotations to various functions
Timm Bäder [Sat, 25 Jan 2020 15:20:00 +0000 (16:20 +0100)]
render: Remove gtk_render_background_get_clip
Timm Bäder [Sat, 25 Jan 2020 14:40:53 +0000 (15:40 +0100)]
Remove gtkutils{.c,private.h}
All but one functions are unused. Move the remaining one into
gtkmodules.c, its only caller.
Timm Bäder [Sat, 25 Jan 2020 07:40:40 +0000 (08:40 +0100)]
cssparser: make a few local variables const
Timm Bäder [Sat, 25 Jan 2020 07:33:51 +0000 (08:33 +0100)]
cssprovider: Parse selectors without a GList
The maximum length of this list in Adwaita is 18, so use a generous
maximum length of 64 for the selector list of a ruleset.
Timm Bäder [Fri, 24 Jan 2020 15:02:34 +0000 (16:02 +0100)]
GtkCssImageUrl: Implement is_computed()
Timm Bäder [Fri, 24 Jan 2020 10:29:43 +0000 (11:29 +0100)]
gl renderer: Avoid some work when rendering border nodes
Timm Bäder [Fri, 24 Jan 2020 10:21:38 +0000 (11:21 +0100)]
cssimage: Add gtk_css_image_to_string()
In line with all the other _to_string() implementations
Timm Bäder [Fri, 24 Jan 2020 06:55:17 +0000 (07:55 +0100)]
window: Replace GtkStyleContext use to get surface transform
We have GtkCssBoxes for this these days.
Matthias Clasen [Sun, 26 Jan 2020 04:49:33 +0000 (23:49 -0500)]
Revert "lookup stats"
This reverts commit
3d9e3390f167a220e8775d08356259f420e045ce.
Matthias Clasen [Sun, 26 Jan 2020 04:49:17 +0000 (23:49 -0500)]
Revert "css: Split style into groups"
This reverts commit
0df0de0b5db87248ad1371ee1bfc8a733ec079e4.
Matthias Clasen [Sun, 26 Jan 2020 04:16:06 +0000 (23:16 -0500)]
css: Split style into groups
Matthias Clasen [Sat, 25 Jan 2020 23:38:42 +0000 (18:38 -0500)]
Adwaita: take out an unnecessary rule
The comment says setting caret-color to currentColor
shouldn't be necessary, and it is right.
Matthias Clasen [Sat, 25 Jan 2020 23:20:40 +0000 (18:20 -0500)]
Adwaita: drop the *
Matthias Clasen [Sat, 25 Jan 2020 23:20:26 +0000 (18:20 -0500)]
lookup stats
Matthias Clasen [Sat, 25 Jan 2020 20:05:14 +0000 (15:05 -0500)]
Fix a scrollbar sizing issue
The recent Adwaita changes inadvertendly made scrollbars
resize on hover. Fix that, by reinstating some lost rules.
Matthias Clasen [Sat, 25 Jan 2020 19:30:25 +0000 (14:30 -0500)]
Revert "Ensure icon themes are loaded with other themes"
This reverts commit
88d26b75491c9a329a836c0d91a8f85ee3bc77d1.
This change caused GtkShortcutWindow to not work anymore,
and we are fixing icon themes differently, anyway.
Matthias Clasen [Sat, 25 Jan 2020 19:29:20 +0000 (19:29 +0000)]
Merge branch 'style-context-redux' into 'master'
Stop using GtkStyleContext internally
See merge request GNOME/gtk!1353
Matthias Clasen [Sat, 18 Jan 2020 16:48:30 +0000 (11:48 -0500)]
popover: Stop using style context getters
Matthias Clasen [Sat, 18 Jan 2020 14:57:13 +0000 (09:57 -0500)]
drag icon: Stop using style context getters
Just go to the css node directly.
Matthias Clasen [Sat, 18 Jan 2020 14:50:04 +0000 (09:50 -0500)]
gskpango: Stop using style context getters
Just go to the css nodes directly.
Matthias Clasen [Sat, 18 Jan 2020 08:12:01 +0000 (03:12 -0500)]
widget: Stop using style context internally
Matthias Clasen [Sat, 25 Jan 2020 06:28:24 +0000 (01:28 -0500)]
Add a profiler mark around renderer realization
This takes time that is worth calling out.
Matthias Clasen [Sat, 25 Jan 2020 02:01:42 +0000 (21:01 -0500)]
Adwaita: Fix some entry styling
This was accidentally broken when parent selectors
were introduced here.
Matthias Clasen [Sat, 25 Jan 2020 01:54:50 +0000 (20:54 -0500)]
GtkSpinner: Pay attention to style changes
Make GtkIcon redraw and resize when style changes
require it.
Matthias Clasen [Sat, 25 Jan 2020 01:54:01 +0000 (20:54 -0500)]
GtkPaned: Pay attention to style changes
Make GtkPaned redraw and resize when style change
require it.
Matthias Clasen [Sat, 25 Jan 2020 01:53:16 +0000 (20:53 -0500)]
GtkIcon: Pay attention to style changes
Make GtkIcon redraw and resize when style changes
require it.
Matthias Clasen [Sat, 25 Jan 2020 00:57:45 +0000 (19:57 -0500)]
css: Update affects flags for icons
We want to differentiate what requires recreating the
texture and what doesn't. In particular, the current
flags are not handling symbolic icons right.
Matthias Clasen [Fri, 24 Jan 2020 23:03:56 +0000 (23:03 +0000)]
Merge branch 'wayland-cursors' into 'master'
Make wayland load cursors on demand
See merge request GNOME/gtk!1350
Matthias Clasen [Fri, 24 Jan 2020 18:33:13 +0000 (13:33 -0500)]
Make wayland load cursors on demand
Copy just enough of libwayland-cursor to make our own
loading. This lets us drop the dependency on libwayland-cursor,
and changes the startup cost for cursor theme loading
from 25ms to 0.1ms.
At the same time, simplify the handling of scaled cursors -
instead of creating an array of theme objects, just make a
single theme object provide all scaled cursor sizes.
Matthias Clasen [Fri, 24 Jan 2020 16:51:18 +0000 (11:51 -0500)]
Revert "css: Print selectors"
This reverts commit
da5d5243241941ba130fc0644e66986f967a2ef3.
And this one too. The commits are there, if people need this
kind of statistics again, they can just be cherry-picked.
Matthias Clasen [Fri, 24 Jan 2020 16:50:40 +0000 (11:50 -0500)]
Revert "css: Print out relative costs of selectors"
This reverts commit
5dcce0c0bdccf5b55a15ff45247b2fc06bf77f7f.
I forgot to ifdef a few things in here, so lets take this out
again.
Matthias Clasen [Fri, 24 Jan 2020 16:20:42 +0000 (16:20 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master
See merge request GNOME/gtk!1348
Matthias Clasen [Fri, 24 Jan 2020 05:12:05 +0000 (00:12 -0500)]
Adwaita: Drop selection mode
This is not really a feature that GTK has; and it lets
us drop a significant amount of css.
Matthias Clasen [Fri, 24 Jan 2020 05:08:46 +0000 (00:08 -0500)]
Adwaita: Drop menu remnants
Menus are gone.
Matthias Clasen [Fri, 24 Jan 2020 04:12:29 +0000 (23:12 -0500)]
css: Print out relative costs of selectors
Count how often each tree node is visited, and print the number
at the end. This gives a good indication what selectors are costly
and should be avoided. #ifdefed out.
Matthias Clasen [Fri, 24 Jan 2020 02:04:15 +0000 (21:04 -0500)]
Adwaita: Remove a wildcard rule for tooltips
These rules are expensive, and don't seem to make
any difference for typical tooltip content.
Matthias Clasen [Fri, 24 Jan 2020 02:00:40 +0000 (21:00 -0500)]
Adwaita: Drop menuitem support
menuitems don't exist anymore.
Matthias Clasen [Thu, 23 Jan 2020 23:51:42 +0000 (18:51 -0500)]
css: Print selectors
Add code that prints all the selectors when a theme
is loaded. #ifdefed out.
Timm Bäder [Fri, 24 Jan 2020 05:18:03 +0000 (06:18 +0100)]
widget: Use gsk_transform_transform_point() in gtk_widget_pick()
This also covers the 2D_AFFINE case.
Timm Bäder [Wed, 22 Jan 2020 07:38:55 +0000 (08:38 +0100)]
gl renderer: handle cross-fade nodes with invisible children
Timm Bäder [Wed, 22 Jan 2020 07:38:41 +0000 (08:38 +0100)]
gl renderer: Handle blur nodes with invisible children
Timm Bäder [Wed, 22 Jan 2020 07:32:11 +0000 (08:32 +0100)]
gl renderer: Make render_rounded_clip_node clearer
Timm Bäder [Tue, 21 Jan 2020 09:01:18 +0000 (10:01 +0100)]
testsuite: Add test cases for last commit
Easy enough to test
Timm Bäder [Tue, 21 Jan 2020 09:00:51 +0000 (10:00 +0100)]
gl renderer: Add builder offset correctly for non-affine modelviews
Timm Bäder [Tue, 21 Jan 2020 08:41:54 +0000 (09:41 +0100)]
GskTransform: Add gsk_transform_transform_point()
Equivalent of gsk_transform_transform_bounds() and
graphene_matrix_transform_point() respectively.
Timm Bäder [Mon, 20 Jan 2020 10:21:52 +0000 (11:21 +0100)]
gl renderer: Shorten shaders a bit
Timm Bäder [Mon, 20 Jan 2020 10:06:56 +0000 (11:06 +0100)]
cssimageicontheme: Avoid copying colors
Timm Bäder [Mon, 20 Jan 2020 09:20:26 +0000 (10:20 +0100)]
cssimagepaintable: Implement is_computed()
Timm Bäder [Mon, 20 Jan 2020 08:26:08 +0000 (09:26 +0100)]
cssimagescaled: Implement is_computed()