[gtk/wip/baedert/transforms6: 3/27] widget: Push transform node when neccessary



commit b6d1ee3559f750594ad4fce1154328689d3a946c
Author: Timm Bäder <mail baedert org>
Date:   Sat Jul 21 15:25:47 2018 +0200

    widget: Push transform node when neccessary

 gtk/gtkwidget.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f0f3cd67b0..54588f05b5 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12952,6 +12952,7 @@ gtk_widget_create_render_node (GtkWidget   *widget,
 {
   GtkWidgetClass *klass = GTK_WIDGET_GET_CLASS (widget);
   GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
+  const gboolean needs_transform = !graphene_matrix_is_identity (&priv->transform);
   GtkCssValue *filter_value;
   double opacity;
   GtkCssStyle *style;
@@ -12971,6 +12972,9 @@ gtk_widget_create_render_node (GtkWidget   *widget,
                            G_OBJECT_TYPE_NAME (widget), widget,
                            allocation.width, allocation.height);
 
+  if (needs_transform)
+    gtk_snapshot_push_transform (snapshot, &priv->transform);
+
   filter_value = _gtk_style_context_peek_property (_gtk_widget_get_style_context (widget), 
GTK_CSS_PROPERTY_FILTER);
   gtk_css_filter_value_push_snapshot (filter_value, snapshot);
 
@@ -13016,7 +13020,10 @@ gtk_widget_create_render_node (GtkWidget   *widget,
   gtk_widget_maybe_add_debug_render_nodes (widget, snapshot);
 #endif
 
-  gtk_snapshot_pop (snapshot);
+  if (needs_transform)
+    gtk_snapshot_pop (snapshot);
+
+  gtk_snapshot_pop (snapshot); /* Debug */
 
   return gtk_snapshot_free_to_node (snapshot);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]