[mutter] background-content: Don't set up pipeline unless it's needed



commit 0efecc1dc56bf8ae654b383accfbcfc5b457dad3
Author: Daniel van Vugt <daniel van vugt canonical com>
Date:   Thu Jul 9 16:19:29 2020 +0800

    background-content: Don't set up pipeline unless it's needed
    
    There was still a possibility we might return and not paint anything
    so there's no need to set up the pipeline before that.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1363

 src/compositor/meta-background-content.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/compositor/meta-background-content.c b/src/compositor/meta-background-content.c
index e3924cae25..8825445de5 100644
--- a/src/compositor/meta-background-content.c
+++ b/src/compositor/meta-background-content.c
@@ -514,13 +514,6 @@ meta_background_content_paint_content (ClutterContent      *content,
   actor_pixel_rect.width = actor_box.x2 - actor_box.x1;
   actor_pixel_rect.height = actor_box.y2 - actor_box.y1;
 
-  setup_pipeline (self, actor, paint_context, &actor_pixel_rect);
-  set_glsl_parameters (self, &actor_pixel_rect);
-
-  /* Limit to how many separate rectangles we'll draw; beyond this just
-   * fall back and draw the whole thing */
-#define MAX_RECTS 64
-
   /* Now figure out what to actually paint */
   if (self->clip_region)
     {
@@ -541,6 +534,13 @@ meta_background_content_paint_content (ClutterContent      *content,
       return;
     }
 
+  setup_pipeline (self, actor, paint_context, &actor_pixel_rect);
+  set_glsl_parameters (self, &actor_pixel_rect);
+
+  /* Limit to how many separate rectangles we'll draw; beyond this just
+   * fall back and draw the whole thing */
+#define MAX_RECTS 64
+
   n_rects = cairo_region_num_rectangles (region);
   if (n_rects <= MAX_RECTS)
     {


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