vulkan: Always render clip extents
authorBenjamin Otte <otte@redhat.com>
Sat, 31 Mar 2018 06:17:42 +0000 (08:17 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 5 Apr 2018 12:56:38 +0000 (14:56 +0200)
Now that we have the full render nodes available, there is not much
benefit in fine-grained control over multiple rectangles.
In particular, it's causing pain with complex regions.

There might be a benefit in clipping to the region's rectangles in cases
like widget-factory where the whole diff is made up of the 2 rectangles
of spinner and the pulsing progress bar, but it needs a good heuristic
for where this is useful.

gsk/vulkan/gskvulkanrender.c

index a544f5df72d4eb3ce07f82cc04255af432ca32f0..29c54aae3af3bf8324d809cc4e988e4ea5e18da9 100644 (file)
@@ -86,7 +86,12 @@ gsk_vulkan_render_setup (GskVulkanRender       *self,
     }
   if (clip)
     {
-      self->clip = cairo_region_reference ((cairo_region_t *) clip);
+      cairo_rectangle_int_t extents;
+      cairo_region_get_extents (clip, &extents);
+      self->clip = cairo_region_create_rectangle (&(cairo_rectangle_int_t) {
+                                                      extents.x, extents.y,
+                                                      extents.width, extents.height
+                                                  });
     }
   else
     {