Commit Graph

992 Commits

Author SHA1 Message Date
Timm Bäder
2bc82da34d inspector: Cache if we have ever constructed a window
Silly optimization to get rid of

gtk_main_do_event
  gtk_inspector_handle_event
    gtk_inspector_window_get_for_display
      g_object_get_data

showing up in profiles even though it's useless since we've never even
created any inspector window in the first place.
2021-09-18 08:29:18 +02:00
Matthias Clasen
d75246a543 inspector: Cosmetics
Make some settings entries smaller, and make the
scales match in size. Also, inline adjustments
in the ui file, since we can do that now.
2021-09-05 12:59:11 -04:00
Benjamin Otte
cbc050b9ed recorder: Make the render nodes in the list draggable
You can (soon) drag any of the nodes directly into the node-editor.
2021-08-30 06:02:16 +02:00
Benjamin Otte
72e2a46c05 inspector: Add support for displaying GL errors
Also, no need to show a GL version if GL isn't available.
2021-07-22 16:27:32 +02:00
Christian Hergert
352898ae9e inspector: fix compilation with broadway 2021-06-17 11:54:00 -07:00
Matthias Clasen
8c75e6896e inspector: Use new get_egl_display apis
This makes the code a bit more concise.

Also, get WGL information when we are using it.
2021-05-13 15:25:18 -04:00
Matthias Clasen
ea162ed016 inspector: Avoid a crash with GL variants
When configuring the inspector display, preserve
debug flags that affect which GL variant we pick.
Otherwise, we may end up with a GLX context on the
default display, and an EGL context on the inspector
one. This hopelessly confuses libepoxy, and things
don't go well when that happens.
2021-05-10 21:25:08 -04:00
Matthias Clasen
e2aa161590 inspector: Show EGL info for X11 as well 2021-05-10 21:24:50 -04:00
Matthias Clasen
a723baec4b inspector: Show text direction
This is not a property, so show it on the misc tab.
2021-05-10 20:55:43 -04:00
Matthias Clasen
564d835fba Merge branch 'broadway-display-scale' into 'master'
broadway: Add a setter for display scale

Closes #3934

See merge request GNOME/gtk!3538
2021-05-10 20:11:38 +00:00
Matthias Clasen
b13c2e17f1 inspector: Support scale changes on Broadway 2021-05-10 10:55:41 -04:00
Matthias Clasen
0108ffe059 inspector: Fix saving css
g_file_replace_contents() does not accept -1
as length, unlike similar apis.
2021-05-09 11:19:43 -04:00
Matthias Clasen
f9d6134247 inspector: Improve monitor information display
Avoid a nested listbox, show the connector,
don't show information we don't have. Also,
disconnect all signal handlers from the display
when the inspector is going away.
2021-05-02 21:02:09 -04:00
Matthias Clasen
dfecc8fe02 inspector: Show keyboard layouts 2021-05-02 21:02:09 -04:00
Matthias Clasen
ecfba2d31b Inspector: Fix a possible undefined use 2021-04-12 21:22:46 -04:00
Matthias Clasen
e7284c23da inspector: Support copying nodes to clipboard
Add a button that copies the serialization of the
selected node to the clipboard.
2021-04-02 21:38:14 -04:00
Matthias Clasen
c5aa35f8ef inspector: Allow inspecting Unicode
Add a way to show text as a Unicode sequence.
This can be helpful in understanding what is
happening with text.
2021-03-21 16:05:10 -04:00
Matthias Clasen
a576bd190b inspector: Respect GDK_DEBUG=vulkan-disable
Respect the debug settings for disabling Vulkan or GL,
and do not try to initialize those contexts. This can
be necessary to work around crashes.

Fixes: #3748
2021-03-17 23:19:08 -04:00
Matthias Clasen
5556907194 inspector: Fix surface transform regression
Ever since we added surface-to-widget transforms,
the autofading of the fps overlay did not work anymore,
since it was given the transient transform node, most
of the time.

Fix this by passing both the root of the node tree and
the node for the toplevel widget to prepare_render, and
hande the widget node to the overlays. Update the
affected overlays that need to have their positioning
adjusted.
2021-03-09 18:27:04 -05:00
Matthias Clasen
a4e7b03185 inspector: Fix a typo
When selecting the "ngl" renderer, the inspector was
saying Renderer: Unknown, due to a typo. Fix that.
2021-02-23 18:37:32 -05:00
Christian Hergert
2a38cecd33 gsk: add OpenGL based GskNglRenderer
The primary goal here was to cleanup the current GL renderer to make
maintenance easier going forward. Furthermore, it tracks state to allow
us to implement more advanced renderer features going forward.

Reordering

This renderer will reorder batches by render target to reduce the number
of times render targets are changed.

In the future, we could also reorder by program within the render target
if we can determine that vertices do not overlap.

Uniform Snapshots

To allow for reordering of batches all uniforms need to be tracked for
the programs. This allows us to create the full uniform state when the
batch has been moved into a new position.

Some care was taken as it can be performance sensitive.

Attachment Snapshots

Similar to uniform snapshots, we need to know all of the texture
attachments so that we can rebind them when necessary.

Render Jobs

To help isolate the process of creating GL commands from the renderer
abstraction a render job abstraction was added. This could be extended
in the future if we decided to do tiling.

Command Queue

Render jobs create batches using the command queue. The command queue
will snapshot uniform and attachment state so that it can reorder
batches right before executing them.

Currently, the only reordering done is to ensure that we only visit
each render target once. We could extend this by tracking vertices,
attachments, and others.

This code currently uses an inline array helper to reduce overhead
from GArray which was showing up on profiles. It could be changed to
use GdkArray without too much work, but had roughly double the
instructions. Cycle counts have not yet been determined.

GLSL Programs

This was simplified to use XMACROS so that we can just extend one file
(gskglprograms.defs) instead of multiple places. The programs are added
as fields in the driver for easy access.

Driver

The driver manages textures, render targets, access to atlases,
programs, and more. There is one driver per display, by using the
shared GL context.

Some work could be done here to batch uploads so that we make fewer
calls to upload when sending icon theme data to the GPU. We'd need
to keep a copy of the atlas data for such purposes.
2021-02-23 14:41:52 -08:00
Emmanuele Bassi
a63a2b26cf Ensure we don't overflow when using g_memdup2()
When we turn integers into size_t we should check we're not going to
make a mess.
2021-02-11 14:22:23 +00:00
Matthias Clasen
1ac9400712 Drop unused logo resource
The inspector no longer sets a window icon.
2021-01-28 12:27:07 -05:00
Matthias Clasen
ccd9827b63 inspector: Redo the actions page
Don't create widgets in bind, instead just set
the new action on the action-editor, and let it
recreate the parts that need to be recreated.
2021-01-21 10:25:13 -05:00
Matthias Clasen
db189cfb9f inspector: Reshuffle action editor
Prepare the action editor for being able to change its
actions after creation.
2021-01-21 10:24:31 -05:00
Matthias Clasen
7527f181d5 inspector: Simplify action editor
We are not using the size group anymore, so drop it.
2021-01-21 10:20:21 -05:00
Matthias Clasen
c05b418512 inspector: Split out variant editor 2021-01-21 10:19:18 -05:00
Matthias Clasen
e97d996fe4 inspector: Redo the shortcuts page
Use a column view here.
2021-01-21 10:19:18 -05:00
Matthias Clasen
0537b167ca inspector: Redo the controllers page
Use a column view, and only show the widgets own
controllers.
2021-01-21 10:19:18 -05:00
Matthias Clasen
fff6b35821 inspector: Redo the controllers page
Use a column view, and only show the widgets own
controllers.
2021-01-20 18:51:01 -05:00
Matthias Clasen
d7060025e0 inspector: Avoid a critical
Avoid a critical when closing the inspector with the
recorder page open.
2021-01-17 10:55:53 -05:00
Matthias Clasen
691b6b88ea inspector: Add a legend for the layout overlay
Colors are more useful if you know what they represent.
2021-01-16 12:38:24 -05:00
Matthias Clasen
e854b90293 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

See merge request GNOME/gtk!2990
2020-12-22 04:53:31 +00:00
Matthias Clasen
147386189f inspector: Show glyphs as in node files
Reuse the glyph serialization code from gsk to
show glyphs in the same way here.
2020-12-21 13:11:46 -05:00
Timm Bäder
c34f98931e layoutoverlay: Avoid adding transparent color nodes
We have a region for the border here, but the color is defined as
transparent black because we don't want to render anything for it.

This way, the generated .node file for the listbox demo in gtk4-demo
with enabled layout borders is 3.5MB instead of 3.8MB.
2020-12-21 10:26:03 +01:00
Timm Bäder
2feac2772f layoutoverlay: Avoid adding 0 sized color nodes
This way, the output node file of the listbox demo in gtk4-demo with
enabled layout borders is only 3.8MB instead of 12MB.
2020-12-21 10:26:03 +01:00
Benjamin Otte
55a242bd81 gsk: Add GskConicGradientNode 2020-12-03 00:47:54 +01:00
Emmanuele Bassi
ac473282a2 Port CellRendererGraph to preferred size vfuncs
Drop use of GtkCellRendererClass.get_size()
2020-11-28 19:21:24 +00:00
Matthias Clasen
b75b359f19 Drop devel styling from our windows
We are about to do a stable release. Time to get used
again to plain old, boring header bars.
2020-11-23 12:10:01 -05:00
Matthias Clasen
c1e05e7c52 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3278

See merge request GNOME/gtk!2856
2020-11-17 19:25:05 +00:00
Matthias Clasen
6b475aacd2 Merge branch 'wip/chergert/gdk-macos-for-master' into 'master'
inspector: handle differences in DPI between backends

See merge request GNOME/gtk!2857
2020-11-17 19:24:47 +00:00
Christian Hergert
37a8c138f9 inspector: handle differences in DPI between backends
This fixes an issue on macOS where the text gets much larger once opening
the inspector.
2020-11-17 10:45:25 -08:00
Matthias Clasen
34d547a2aa inspector: Limit the width of readonly properties
For readonly properties, we show the serialized value
in a label. If we don't take precautions, this can cause
our window to grow extremely wide, and break things.
So, ellipsize things at a reasonable size.

Fixes: #3278
2020-11-17 13:36:57 -05:00
Benjamin Otte
f2284ff40f rendernode: Rename all gsk_render_node_peek_*() functions
Those are getters, they should be gsk_render_node_get_*() functions.
2020-11-17 19:04:39 +01:00
Matthias Clasen
67411701c6 inspector: Show accessible object path
Show the object path of the object on the a11y bus,
this is can be useful information. While we are here,
make sure that the Inspector does not throw criticals
when used with GTK_NO_A11Y=1.
2020-10-20 21:56:54 -04:00
Matthias Clasen
a39e519bed inspector: Clear overlays on unroot
In dispose(), we can't access the root anymore,
since we're already unrooted.

Fixes: #3265
2020-10-17 13:11:58 -04:00
Matthias Clasen
4bd2595421 actionmuxer: Make it possible to enumerate local actions
This will be useful for exposing actions via the
AT-SPI Actions interface.

Update all callers.
2020-10-15 16:32:55 -04:00
Timm Bäder
eca3eab96f Remove unneeded gtkstylecontext.h includes 2020-10-14 15:06:12 -04:00
Christian Hergert
fb02c99868 macos: port gtk to GDK_WINDOWING_MACOS
For the various uses of GDK_WINDOWING_QUARTZ, we need to use
alternatives from GDK_WINDOWING_MACOS.

Some minor loss of functionality is here, such as icons sent with
application menus. That can certainly be added back at a future
point.
2020-10-14 15:06:12 -04:00
Alexander Larsson
7ea755e206 Add GskGLShaderNode and GskGLShader
A GskGLShader is an abstraction of a GLSL fragment shader that
can produce pixel values given inputs:
 * N (currently max 4) textures
 * Current arguments for the shader uniform
Uniform types are: float,(u)int,bool,vec234)
There is also a builder for the uniform arguments which are
passed around as immutable GBytes in the built form.

A GskGLShaderNode is a render node that renders a GskGLShader inside a
specified rectangular bounds. It renders its child nodes as textures
and passes those as texture arguments to the shader. You also pass it
a uniform arguments object.
2020-09-29 09:51:16 +02:00