summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel van Vugt <daniel.van.vugt@canonical.com>2020-07-09 16:19:29 +0800
committerRobert Mader <robert.mader@posteo.de>2020-08-30 12:04:07 +0000
commit0efecc1dc56bf8ae654b383accfbcfc5b457dad3 (patch)
tree9f6be2e16ff1e6dd36f8a002b2cf669b63f77134
parenta1dd3c43fbb77e5e4a5ffe92af1a611592543b9e (diff)
downloadmutter-0efecc1dc56bf8ae654b383accfbcfc5b457dad3.tar.gz
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
-rw-r--r--src/compositor/meta-background-content.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/compositor/meta-background-content.c b/src/compositor/meta-background-content.c
index e3924cae2..8825445de 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)
{