[gtk/wip/baedert/transforms6: 15/52] widget: Push transform node when neccessary



commit 4d3a07c5160710cb4cb93b01d9f62913339ab1fe
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 8d785a56f2..fa33327ae7 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -13011,6 +13011,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;
@@ -13030,6 +13031,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);
 
@@ -13089,7 +13093,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]