summaryrefslogtreecommitdiff
path: root/gsk/gskvulkanrenderpass.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2017-10-08 18:36:57 -0400
committerMatthias Clasen <mclasen@redhat.com>2017-10-08 19:21:52 -0400
commit5280a2c8740f003a1321e4d0f3af79dcf3d4e09d (patch)
tree7449ddd3fc8272db244864be671432b5ece40e9f /gsk/gskvulkanrenderpass.c
parent2cd65158a0253adf8bdca43588706889d0807969 (diff)
downloadgtk+-5280a2c8740f003a1321e4d0f3af79dcf3d4e09d.tar.gz
Revise the coordinate handling one more time
This makes the new reftests pass and hopefully does not break other things.
Diffstat (limited to 'gsk/gskvulkanrenderpass.c')
-rw-r--r--gsk/gskvulkanrenderpass.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gsk/gskvulkanrenderpass.c b/gsk/gskvulkanrenderpass.c
index a216faea08..a47d3bbc4e 100644
--- a/gsk/gskvulkanrenderpass.c
+++ b/gsk/gskvulkanrenderpass.c
@@ -1009,21 +1009,31 @@ gsk_vulkan_render_pass_upload (GskVulkanRenderPass *self,
{
GskRenderNode *start = gsk_cross_fade_node_get_start_child (op->render.node);
GskRenderNode *end = gsk_cross_fade_node_get_end_child (op->render.node);
+ const graphene_rect_t *bounds = &op->render.node->bounds;
op->render.source = gsk_vulkan_render_pass_get_node_as_texture (self,
render,
uploader,
start,
- &op->render.node->bounds,
+ &start->bounds,
clip,
&op->render.source_rect);
+ op->render.source_rect.origin.x = (bounds->origin.x - start->bounds.origin.x)/start->bounds.size.width;
+ op->render.source_rect.origin.y = (bounds->origin.y - start->bounds.origin.y)/start->bounds.size.height;
+ op->render.source_rect.size.width = bounds->size.width / start->bounds.size.width;
+ op->render.source_rect.size.height = bounds->size.height / start->bounds.size.height;
+
op->render.source2 = gsk_vulkan_render_pass_get_node_as_texture (self,
render,
uploader,
end,
- &op->render.node->bounds,
+ &end->bounds,
clip,
&op->render.source2_rect);
+ op->render.source2_rect.origin.x = (bounds->origin.x - end->bounds.origin.x)/end->bounds.size.width;
+ op->render.source2_rect.origin.y = (bounds->origin.y - end->bounds.origin.y)/end->bounds.size.height;
+ op->render.source2_rect.size.width = bounds->size.width / end->bounds.size.width;
+ op->render.source2_rect.size.height = bounds->size.height / end->bounds.size.height;
}
break;