GTK 4.14 graphics toolkit with new engines for OpenGL and Vulkan is available

After seven months of development, the release of a multi-platform toolkit for creating a graphical user interface has been published - GTK 4.14.0. GTK 4 is being developed as part of a new development process that attempts to provide application developers with a stable and supported API for several years that can be used without the fear of having to rewrite applications every six months due to API changes in the next GTK branch.

In the future, it is planned to form an experimental branch 4.90, which will develop functionality for the future release of GTK5. The GTK5 branch will include changes that violate compatibility at the API level, for example, related to deprecating some widgets, such as the old file selection dialog. The possibility of ending support for the X5 protocol in the GTK11 branch and leaving the ability to work only using the Wayland protocol is also being discussed.

Among the most notable improvements in GTK 4.14 are:

  • It includes new unified rendering engines "ngl" and "vulkan" using the OpenGL (GL 3.3+ and GLES 3.0+) and Vulkan graphics APIs. Both engines are based on the Vulkan API, but the β€œngl” engine has a separate abstraction layer for OpenGL that runs on top of Vulkan, taking into account the differences between OpenGL and Vulkan. This approach made it possible to use a common infrastructure in both engines for processing the scene graph, transformations, caching textures and glyphs. Unification also significantly simplified the maintenance of the code base of both engines and keeping them up to date and synchronized.

    Unlike the old gl engine, which used a separate simple shader for each type of render node and periodically re-sorted the data during offscreen rendering, the new engines instead of offscreen rendering use a complex shader (ubershader) that interprets the data from the buffer. Among the distinctive features of the new engines, contour smoothing is mentioned (allows you to preserve fine details and achieve drawing smoother contours), the formation of arbitrary gradients (any number of colors and anti-aliasing can be used) and fractional scaling.

  • The new "ngl" rendering engine is enabled by default, and support for the Vulkan graphics API is also enabled by default. When building in the default configuration, Vulkan 1.3 support is now required.
  • The GSK library (GTK Scene Kit), which provides the ability to render graphic scenes through OpenGL and Vulkan, has made significant improvements related to font rendering, hinting, and the use of non-integer scale values ​​when displaying text. When hinting (smoothing the glyph outline during rasterization to increase clarity on low-resolution screens), subpixel positioning of glyphs is implemented. The quality of font rendering has been improved at non-integer scale values ​​(for example, 125%). Implemented support for eviction of elements from caches for glyphs and textures. Improved efficiency of glyph caching.
  • As part of the move away from using the Cairo library in favor of GPU rendering, support for β€œPaths” has been added for drawing shapes and areas using a sequence of lines or cubic and quadratic Bezier curves. For drawing with paths, there is a GskPath object that defines the parameters of lines or curves, as well as GskPathBuilder objects for creating curves, GskPathPoint for defining a point on a shape, and GskPathMeasure for taking measurements such as the length of a path.
    GTK 4.14 graphics toolkit with new engines for OpenGL and Vulkan is available
  • The GDK library, which provides a layer between GTK and the graphics subsystem, has expanded support for the DMA-BUF mechanism, which allows the use of kernel-level buffers addressed using a descriptor, which makes it possible, instead of copying pixel data, to transfer them between kernel subsystems through a descriptor. In the context of GTK, DMA-BUF can be used to minimize copying of pixel data during compositing and when working with video (for example, video can be recorded by a hardware decoder in dmabuf, then attached to a Wayland surface and passed to a compositing manager for UI and output compositing to the screen without unnecessary data copying operations).

    A GtkGraphicsOffload widget has been added to directly send content such as video to the composite manager (bypassing the GSK render), and a GdkDmabufTextureBuilder class has been added to create GdkTexture objects from dmabuf to create content for direct transfer. Pipewire, video4linux or gstreamer can be used as a source for dmabuf. dmabuf NV16, NV61, NV24, NV42 and YUV formats are supported.

  • Added the GtkPrintDialog class, designed for generating print dialogs and offering an asynchronous API for use instead of GtkPrintOperation.
  • The GtkEmojiChooser widget has updated Emoji data and added the ability to search in different languages, taking into account different locales.
  • The GtkEntry widget has improved tracking of changes made by the user (to implement the undo operation).
  • In the GtkFileChooser widget, the opening of the file selection dialog has been accelerated.
  • The GtkShortcutsWindow class, which displays tooltips for keyboard shortcuts and screen gestures, is adapted for small screens.
  • Inspection mode (GTK inspector) provides display of information about OpenGL, subsurfaces and FPS.
  • Added "compare" command to gtk4-rendernode-tool utility.
  • A new utility, gtk4-path-tool, has been proposed for working with paths.
  • Auto-recording support has been added to the gtk4-node-editor utility.
  • Fixed a crash that occurred when using Wayland in non-GNOME Shell-based environments.
  • Added new features for people with disabilities related to the display of complex formatted text, the operation of WebKitGTK and the display of notifications. Improved support for ARIA specifications. Added GtkAccessibleText interface for using accessibility features in third-party text widgets. The GtkText interface has added support for the AT-SPI protocol for interacting with screen readers.
  • Added GPU rendering capability using the WGL API on the Windows platform.
  • Reduced memory consumption when loading CSS-based themes.

Source: opennet.ru

Add a comment