Commit Graph

58411 Commits

Author SHA1 Message Date
Benjamin Otte
d81cf5a443 rendernodeparser: Handle Cairo being stupid
Cairo writes to finished streams, so we have to make sure to keep the
stream around to allow it to do that.
2019-06-03 17:22:11 +02:00
Timm Bäder
a0cb68283d gl renderer: Dont' memcmp() a GskTransform 2019-06-03 17:07:26 +02:00
Timm Bäder
88344ccf4e widget: Unref priv->{allocated_,}transform 2019-06-03 17:03:02 +02:00
Timm Bäder
d228f4bb76 gl renderer: Don't ref transform twice
That's gonna leak it otherwise.
2019-06-03 17:03:02 +02:00
Timm Bäder
3a49c0eb2f glyphcache: Don't leak hashtables 2019-06-03 17:03:02 +02:00
Timm Bäder
05ca772631 GskTransform: Ignore identity transforms
We often end up with e.g. a scale of 1 or a translation by 0/0. Ignore
those transforms since they don't do anything.
2019-06-03 17:03:02 +02:00
Timm Bäder
efe9bba343 gl renderer: Ref transform before using it
Fixes #1929
2019-06-03 17:03:02 +02:00
Timm Bäder
fb1f929c38 gl renderer: Dont' unnecessarily to_matrix transforms 2019-06-03 17:03:02 +02:00
Matthias Clasen
6560a35c9c Merge branch 'menu-sizing' into 'master'
menu: Update scrollbar policy

Closes #1930

See merge request GNOME/gtk!908
2019-06-03 14:57:46 +00:00
Matthias Clasen
c7ccaa5ef2 menu: Update scrollbar policy
We want to avoid sizing problems for small menus
due to the vertical scrollbar imposing a min-height on
its slider.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1930
2019-06-03 14:49:13 +00:00
Benjamin Otte
3ae15aad16 Merge branch 'cherry-pick-ae2ef147' into 'master'
gtk: fix weed_out_neg_zero() in spinbutton and scale

See merge request GNOME/gtk!906
2019-06-03 11:29:54 +00:00
Daniel Mustieles
42e0c9892c Updated Spanish translation 2019-06-03 12:26:36 +02:00
Matthias Clasen
286fd742a6 Merge branch 'glyph-memdup' into 'master'
gl: Avoid a memdup in glyph upload

See merge request GNOME/gtk!907
2019-06-03 03:07:31 +00:00
Matthias Clasen
3c6c07e94d gl: Avoid a memdup in glyph upload
We don't need to dup the memory here if we
set up the image surface properly. This won't
matter for most glyphs, but some of them can
be big.
2019-06-03 02:47:52 +00:00
Matthias Clasen
a2c3c65729 Merge branch 'big-glyphs' into 'master'
Big glyphs

See merge request GNOME/gtk!904
2019-06-03 02:28:24 +00:00
Matthias Clasen
92994bac6c Save gsk output from ci 2019-06-03 02:09:46 +00:00
Matthias Clasen
3788e1dea7 testsuite: Pass --output for gsk tests
We want to keep the output from ci runs.
So we now write the .out.png and .diff.png
files to build/testsuite/gsk/compare/$RENDERER.
2019-06-03 02:09:04 +00:00
Matthias Clasen
e0bf301d34 gsk tests: Add an --output option
This will be used to save artifacts in ci.
2019-06-03 02:09:04 +00:00
Matthias Clasen
e0803f039f gl: Fix glyph cache aging
The logic here seems faulty. We want to keep
a timestamp that tells us when the glyph was
last used, so always update the timestamp.

And whenever we use a glyph, it turns 'young'
again, so remove it from the old pixels
accounting.

The (MAX_AGE, MAX_AGE+CHECK_INTERVAL) interval
is only relevant to prevent us from turning
a cached glyph old more than once, and that
is already taken care of.
2019-06-03 02:09:04 +00:00
Matthias Clasen
3059d76b4c Add code to dump out the glyph caches 2019-06-03 02:09:04 +00:00
Matthias Clasen
0a09b8dca7 gl: Improve cache dropping code
There was a TODO here to avoid iterating the
glyphs multiple times, so avoid that. And
actually log the number of glyphs that was dropped.
2019-06-03 02:09:04 +00:00
Matthias Clasen
ad2a1c92ce gl: Improve glyph cache logging
Use g_message to be consistent, and make the
message fit a line.
2019-06-03 02:09:04 +00:00
Matthias Clasen
fd4182f5c5 gl: Log creation of glyph caches
Now that they can be of different sizes, this
is somewhat interesting.
2019-06-03 02:09:04 +00:00
Matthias Clasen
c7387a8e7f gsk: Test huge glyphs
These don't fit in the glyph cache.
2019-06-03 02:08:36 +00:00
Matthias Clasen
a64dfb1dfc gl: Make the glyph cache survive big glyphs
Create an extra atlas of just the right size for
each huge glyph. Not pretty, but works.
2019-06-03 02:08:36 +00:00
Matthias Clasen
1c1d4f32c8 gsk: Test big glyphs
These are big, but still fit in the glyph cache.
Therefore, the test succeeds.
2019-06-03 02:08:36 +00:00
Michael Natterer
caf50bcb93 gtk: fix weed_out_neg_zero() in spinbutton and scale
It was not copying the terminating \0 in the string, breaking output
in spinbutton (didn't try scale). Fixes #3452.


(cherry picked from commit ae2ef1472c)
2019-06-03 00:34:44 +00:00
Benjamin Otte
7e9cb07a92 Merge branch 'for-master' into 'master'
For master

See merge request GNOME/gtk!903
2019-06-03 00:22:40 +00:00
Matthias Clasen
3a42aab680 Merge branch 'wip/chergert/marshalling-gtk4' into 'master'
gtk: fix all uses of g_cclosure_marshal_generic

See merge request GNOME/gtk!905
2019-06-02 23:34:02 +00:00
Christian Hergert
41e373f10c gtk: fix all uses of g_cclosure_marshal_generic
This adds specific marshallers for all of the locations where a generic
marshaller is being used. It also provides va_marshallers to reduce the
chances that we get stack traces from perf going through ffi_call_unix64.

This is forward ported from gtk-3-24.

# Conflicts:
#	gtk/gtkeventcontrollerkey.c
#	gtk/gtkeventcontrollermotion.c
#	gtk/gtkgesture.c
#	gtk/gtkgesturemultipress.c
2019-06-02 14:24:51 -07:00
Benjamin Otte
f9562757ff gtk-demo: Fix sliding puzzle demo
1. Menubuttons aren't buttons

2. For paintables without aspect ratios, use 1.0
2019-06-02 21:18:56 +02:00
Benjamin Otte
5a0c8805fc transform: Coalesce similar transforms
If somebody does a transform like
  scale(5) scale(10) translate(1,1) translate(5,0)
store it instead as
  scale(50) translate(6,1)
This way, less memory is consumed and transforms are easier to read.

In particular, this simplifies the typical transforms we do in GTK,
which are just one translation after another.
2019-06-02 21:18:56 +02:00
Matthias Clasen
1a4e360c2c Don't generate mipmaps needlessly
GL_LINEAR doesn't use mipmaps, so don't generate them.
2019-06-02 18:29:11 +00:00
Benjamin Otte
69629ebb1a transform: Treat 0 perspective transforms as identity
This happens if you apply a perspective transform and its inverse, which
is the negative version of the perspective.
2019-06-02 15:12:37 +02:00
Piotr Drąg
68a987922a Update Polish translation 2019-06-02 14:47:42 +02:00
Timm Bäder
a51b694314 gl renderer: Remove homegrown transform_bounds code
GskTransform can do this for us now.
2019-06-02 11:43:06 +02:00
Timm Bäder
b6cc774312 transform: Add G_GNUC_WARN_UNUSED_RESULT annotations
These functions return the new transform so their return value should
really never be ignored.
2019-06-02 10:33:30 +02:00
Timm Bäder
db548ee2a0 gl renderer: Fix scale computation
We don't need to just look at the scale of the new modelview matrix, but
at the one we get when multiplying the new one with the current one.

Test case attached.
2019-06-02 10:25:39 +02:00
Timm Bäder
f999572e8f gl renderer: Use GskTransform in render ops builder
for the modelview matrix. We need this later.
2019-06-02 10:12:09 +02:00
Timm Bäder
f1996783ec gl renderer: Fix rounded rect intersection code
Test case attached.

Fixes #1920
2019-06-02 08:31:44 +02:00
Matthias Clasen
aa267c1c84 Add gtkmenubarprivate.h
Move private api into a private header.
2019-06-01 21:56:49 +00:00
Matthias Clasen
3dea73bd4a Cosmetics
Remove comments that are old enough to still
talk about option menus and item factories.
2019-06-01 21:56:49 +00:00
Matthias Clasen
29252eac6a Merge branch 'restack-gtk4' into 'master'
GDK W32: Ensure correct stacking of popup windows (GTK4)

See merge request GNOME/gtk!902
2019-06-01 19:47:32 +00:00
Руслан Ижбулатов
2ace3113d6 GDK W32: Ensure correct stacking of popup windows
1) In the SetWindowPos() function (and the WINDOWPOS struct) the
   "hWndInsertAfter" argument/field means the window that will be
   directly above after the change, not the window that will be
   directly below. MSDN says "precedes" for SetWindowPos(), but
   WINDOWPOS documentation is more precise: this is the window
   behind which the affected window will be placed. Apparently,
   Z-axis goes back-to-front.
   Therefore, logging should be reworded correctly.

2) When we switch away from the application and then switch back
   to a transient window, we need to bring up its transient-owner
   (and its transient-owner's owner and so forth) as well,
   otherwise our transient (modal) window might be transient for
   something that might not be visible.

3) When we bring up a window, we should bring all of its children
   (popup windows) on top of it.
   Because Windows doesn't provide a function to bring one window
   on top of the other, we have to work around this by calling
   SetWindowPos() twice, swapping the windows between the calls.
2019-06-01 19:23:30 +00:00
Balázs Úr
0ee9a4ff90 Update Hungarian translation 2019-06-01 11:26:53 +00:00
Matthias Clasen
03964b5edb Remove an unused enum
No use of GtkArrowPlacement anywhere.
2019-06-01 04:11:22 +00:00
Matthias Clasen
0c7e567c32 Merge branch 'global-coords' into 'master'
Drop global coordinates

See merge request GNOME/gtk!899
2019-06-01 03:53:13 +00:00
Matthias Clasen
e31190cf7c Update css node results 2019-06-01 03:47:19 +00:00
Matthias Clasen
fcdea03796 Fix menu item accessible
The menu shell is not a direct parent anymore.
2019-06-01 03:39:12 +00:00
Matthias Clasen
0a33d74c1b tests: Fix issues with menu shells
The menu shell is no longer the direct
parent of menu items.
2019-06-01 03:32:10 +00:00