[gtk/wip/baedert/transforms6: 29/61] widget: Push transform node when neccessary



commit 26e3bea58545e354dd389da26cb22f924a0e36af
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 dd60aa7b32..3dc50b4efb 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12908,6 +12908,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;
@@ -12927,6 +12928,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);
 
@@ -12972,7 +12976,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]