gsk: Add the ability to create fallback renderers

Desktop / GNOME / GTK - Emmanuele Bassi [gnome.org] - 18 October 2016 05:49 UTC

While porting GTK to GskRenderer we noticed that the current fallback code for widgets using Cairo to draw is not enough to cover all the possible cases.

For instance, if a container widget still uses GtkWidget::draw to render its children, and at least one of them has been ported to using render nodes instead, the container won't know how to draw it.

For this reason we want to provide to layers above GSK the ability to create a "fallback" renderer instance, created using a "parent" GskRenderer instance, but using a Cairo context as the rendering target instead of a GdkDrawingContext.

GTK will use this inside the gtk_widget_draw() implementation, if a widget implements GtkWidgetClass.get_render_node().

dace079 gsk: Add the ability to create fallback renderers
gsk/gskcairorenderer.c | 6 +++-
gsk/gskglrenderer.c | 14 ++++++--
gsk/gskrenderer.c | 79 ++++++++++++++++++++++++++++++++++++++++++++--
gsk/gskrenderer.h | 5 +++
gsk/gskrendererprivate.h | 1 +
gtk/gtkwidget.c | 70 ++++++++++++++++++++++++++++------------
6 files changed, 149 insertions(+), 26 deletions(-)

Upstream: git.gnome.org


  • Share