Jump to content

GTK Scene Graph Kit

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Diannaa (talk | contribs) at 17:31, 17 March 2017 (remove copyright content copied from https://www.bassi.io/articles/2014/07/29/guadec-2014-gsk/). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
GSK
Original author(s)Manuelle Bassi et al.
Developer(s)The GNOME Project
Initial release2017-03-24
Preview release
3.89.5
Written inC
Operating systempart of GTK+
TypeSoftware library
LicenseLGPL
Websitedeveloper.gnome.org/gsk4/unstable/
Simplified software architecture of GTK+.
CSS taxonomy.

GSK (GTK+ Scene Graph Kit) is the rendering and scene graph API for GTK+. GSK lies between the graphical control elements (widgets) and the rendering.

Like GTK+, GDK is licensed under the GNU Lesser General Public License (LGPL).

Rationale

GSK is part of GTK+. GSK is meant to be used by GTK+ itself and by GTK-based applications (e.g. GNOME Shell (sic!), GNOME Videos, GNOME Boxes, …) that wish to replace Clutter for their UI. Any application which makes use of GTK's graphical control elements (widgets), as opposed to those applications getting a GTK window and then drawing themselves on it, benefit from GSK.

Drawing the widgets (whatever their complexity) without a scenegraph lead to over rendering, poor performance and poor battery usage.

GTK+ has been migrating steadily to a Cascading Style Sheet (CSS)-based model for how widgets are styled, rendered, and animated. This comes with a performance hit. Shadows, borders, padding, and style properties have well-defined semantics in CSS, and it was becoming painful to try and implement some of those semantics in the basic GTK+ drawing model.

The way widgets were drawn in GTK+ (when not using Clutter), was, that a draw function (part of GDK hence the name (GIMP "Drawing" Kit)) drew everything. There was no way to know, what has just been drawn. To know where the mouse pointer was currently hovering over, the current position had to be computed.

With GSK, it should be fairly easy to write complex graphical control elements (widgets) and still track easily the whereabout of the mouse pointer. Getting more conformation with CSS should also arrive.

GSK makes use of graphene,[1] an external library wich houses a collection of geometry types — points, sizes, rectangles, vectors, quads, quaternions, matrices. graphene has been ported to the Meson build system.

Rendering APIs

As of GTK+ version 2.89.5 GSK implements rendering over


History

BIG TODO, let's start with a bullet list + references, then transform this into proper text

Clutter

Clutter was released to the public on June 22, 2006. The integration library "clutter-gtk" has been available since 2006-11-29.[2]

At the 2nd Desktop Summit in August 2011 in Berlin there was quite some talk regarding "GTK+ 4.0 and Clutter 2.0".[3]

Idea to introduce a scene graph to GTK+

In 2008 developers are also considering new directions for the library, including removing deprecated API components and adding an integrated scene graph (canvas) system, similar to the Clutter graphics library, effectively integrating GTK+ with OpenGL.[4][5]

In its history GDK contained and linked with a couple of different Canvases, see e.g. ProjectRidley/CanvasOverview or CanvasOverview/Canvases

GSK

[6]

In June 2006 Clutter, an OpenGL-based 'interactive canvas' library, was released. Clutter has its own scene graph, and GNOME developers preferred to use Clutter's scene graph with GTK+, facilitated by a library called clutter-gtk.[7] Clutter can be embedded into every GNOME application by using the clutter-gtk library. The clutter-gtk library provides a GtkClutterEmbed GTK+ widget which can be used to display a ClutterStage.

Some thought went into how to merge Clutter and GTK+ in a better way than the clutter-gtk library.

In 2011 Firefox introduced "Azure" and Joe Drew and Bas Schouten bothered with some explanations.[8][9][10]

  • GTK+ Scene Graph Kit (GSK) is the forthcoming scene graph for GTK+ in the process of being written by Emanuele Bassi.[11]
  • 2014-Jul-30 Emanuelle stated, he thought there shouldn't be a – stand-alone – Clutter 2.0.[12]

There was a presentation at the 2014 Developer Experience Hackfest regarding a new scene graph for GTK+ aimed at being merged into GTK+ 3.16.[13] Then GSK was planned to be ready and fully integrated into GTK+ version 3.20, to be released in March 2016. This was postponed to 3.22.,[14] and then finally merged into 3.90.

Having OpenGL (or OpenGL ES) support in GDK facilitates a slightly better control of the graphics pipeline; OpenGL is well suited for compositing textured data but totally unsuited for drawing.[citation needed]

The latest information about the status of GSK is from GUADEC 2016.[15]

Other projects

See also

References

  1. ^ Bassi, Emmanuele (2014-05-02). "Graphene".
  2. ^ Bassi, Emmanuele (2006-11-29). "add clutter-gtk".
  3. ^ Bassi, Emmanuele (2011-08-31). "GTK+ 4.0 and Clutter 2.0: rainbows and unicorns".
  4. ^ Alberto Ruiz's Blog
  5. ^ Havoc Pennington's scene graph proposal
  6. ^ Bassi, Emmanuele (2014-07-29). "The GTK+ Scene Graph Kit".
  7. ^ "clutter-gtk on git.gnome".
  8. ^ "Introducing the Azure project". 2011-04-26.
  9. ^ "Comparing Performance: Azure vs Cairo". 2011-06-06.
  10. ^ "Releasing Azure". 2011-08-16.
  11. ^ Bassi, Emmanuele (2014-07-29). "The GTK+ Scene Graph Kit".
  12. ^ Bassi, Emmanuele (2014-07-30). "Halting Problem – Future in the Past".
  13. ^ "2014 Developer Experience Hackfest: A scene graph for GTK+ 3.16".
  14. ^ "GNOME Wiki: roadmap for GTK+".
  15. ^ Bassi, Emmanuele (2016-08-16). "GTK: are we in the future, yet?".