summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2017-09-30 11:04:16 -0400
committerMatthias Clasen <mclasen@redhat.com>2017-09-30 17:58:23 -0400
commit50bea3732005e24789120ecd87c389a5e6eaec14 (patch)
tree92c031c3afbc9ed5a059ff9af7efaf7b3f87b7a6
parent983e0b79565dfb3318b35d6020a33054abe44a00 (diff)
downloadgtk+-50bea3732005e24789120ecd87c389a5e6eaec14.tar.gz
Reshuffle things a little bit
Instead of having a function with lots of arguments in GskVulkanRender that we call from GskVulkanRenderPass which then just calls back into GskVulkanRenderPass, just create the new render pass object locally, and an api to add it to the list that GskVulkanRender keeps. This makes it a lot easier to preserve all the relevant parameters from the parent render pass.
-rw-r--r--gsk/gskvulkanrender.c34
-rw-r--r--gsk/gskvulkanrenderpass.c22
-rw-r--r--gsk/gskvulkanrenderprivate.h9
3 files changed, 24 insertions, 41 deletions
diff --git a/gsk/gskvulkanrender.c b/gsk/gskvulkanrender.c
index d4f4e4ed20..06914b1679 100644
--- a/gsk/gskvulkanrender.c
+++ b/gsk/gskvulkanrender.c
@@ -310,7 +310,7 @@ gsk_vulkan_render_add_cleanup_image (GskVulkanRender *self,
self->cleanup_images = g_slist_prepend (self->cleanup_images, image);
}
-static void
+void
gsk_vulkan_render_add_render_pass (GskVulkanRender *self,
GskVulkanRenderPass *pass)
{
@@ -344,38 +344,6 @@ gsk_vulkan_render_add_node (GskVulkanRender *self,
}
void
-gsk_vulkan_render_add_node_for_texture (GskVulkanRender *self,
- GskRenderNode *node,
- const graphene_matrix_t *mv,
- const graphene_rect_t *bounds,
- GskVulkanImage *target,
- VkSemaphore semaphore)
-{
- GskVulkanRenderPass *pass;
- cairo_region_t *clip;
-
- clip = cairo_region_create_rectangle (&(cairo_rectangle_int_t) {
- 0, 0,
- gsk_vulkan_image_get_width (target),
- gsk_vulkan_image_get_height (target)
- });
-
- pass = gsk_vulkan_render_pass_new (self->vulkan,
- target,
- 1,
- mv,
- bounds,
- clip,
- semaphore);
-
- cairo_region_destroy (clip);
-
- gsk_vulkan_render_add_render_pass (self, pass);
-
- gsk_vulkan_render_pass_add (pass, self, node);
-}
-
-void
gsk_vulkan_render_upload (GskVulkanRender *self)
{
GList *l;
diff --git a/gsk/gskvulkanrenderpass.c b/gsk/gskvulkanrenderpass.c
index 56fb8b2662..6b10345f53 100644
--- a/gsk/gskvulkanrenderpass.c
+++ b/gsk/gskvulkanrenderpass.c
@@ -689,6 +689,8 @@ gsk_vulkan_render_pass_get_node_as_texture (GskVulkanRenderPass *self,
{
VkSemaphore semaphore;
graphene_rect_t view;
+ cairo_region_t *clip;
+ GskVulkanRenderPass *pass;
graphene_matrix_transform_bounds (&self->mv, bounds, &view);
@@ -715,7 +717,25 @@ gsk_vulkan_render_pass_get_node_as_texture (GskVulkanRenderPass *self,
&semaphore);
g_array_append_val (self->wait_semaphores, semaphore);
- gsk_vulkan_render_add_node_for_texture (render, node, &self->mv, &view, result, semaphore);
+
+ clip = cairo_region_create_rectangle (&(cairo_rectangle_int_t) {
+ 0, 0,
+ gsk_vulkan_image_get_width (result),
+ gsk_vulkan_image_get_height (result)
+ });
+
+ pass = gsk_vulkan_render_pass_new (self->vulkan,
+ result,
+ 1,
+ &self->mv,
+ &view,
+ clip,
+ semaphore);
+
+ cairo_region_destroy (clip);
+
+ gsk_vulkan_render_add_render_pass (render, pass);
+ gsk_vulkan_render_pass_add (pass, render, node);
gsk_vulkan_render_add_cleanup_image (render, result);
return result;
diff --git a/gsk/gskvulkanrenderprivate.h b/gsk/gskvulkanrenderprivate.h
index 09751cb064..1455bb7238 100644
--- a/gsk/gskvulkanrenderprivate.h
+++ b/gsk/gskvulkanrenderprivate.h
@@ -69,13 +69,8 @@ void gsk_vulkan_render_add_cleanup_image (GskVulk
void gsk_vulkan_render_add_node (GskVulkanRender *self,
GskRenderNode *node);
-void gsk_vulkan_render_add_node_for_texture (GskVulkanRender *self,
- GskRenderNode *node,
- const graphene_matrix_t *mv,
- const graphene_rect_t *bounds,
- GskVulkanImage *target,
- VkSemaphore semaphore);
-
+void gsk_vulkan_render_add_render_pass (GskVulkanRender *self,
+ GskVulkanRenderPass *pass);
void gsk_vulkan_render_upload (GskVulkanRender *self);