[gtk+] Revise coordinate handling for blend nodes



commit 090ec2e56fab85904ef929e8216ec8b0c7ce16a5
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Oct 8 20:06:33 2017 -0400

    Revise coordinate handling for blend nodes
    
    This is the same change that was applied to cross-fade
    nodes.

 gsk/gskvulkanrenderpass.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/gsk/gskvulkanrenderpass.c b/gsk/gskvulkanrenderpass.c
index a47d3bb..3a1a23c 100644
--- a/gsk/gskvulkanrenderpass.c
+++ b/gsk/gskvulkanrenderpass.c
@@ -1041,21 +1041,31 @@ gsk_vulkan_render_pass_upload (GskVulkanRenderPass  *self,
           {
             GskRenderNode *top = gsk_blend_node_get_top_child (op->render.node);
             GskRenderNode *bottom = gsk_blend_node_get_bottom_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,
                                                                             top,
-                                                                            &op->render.node->bounds,
+                                                                            &top->bounds,
                                                                             clip,
                                                                             &op->render.source_rect);
+            op->render.source_rect.origin.x = (bounds->origin.x - 
top->bounds.origin.x)/top->bounds.size.width;
+            op->render.source_rect.origin.y = (bounds->origin.y - 
top->bounds.origin.y)/top->bounds.size.height;
+            op->render.source_rect.size.width = bounds->size.width / top->bounds.size.width;
+            op->render.source_rect.size.height = bounds->size.height / top->bounds.size.height;
+
             op->render.source2 = gsk_vulkan_render_pass_get_node_as_texture (self,
                                                                              render,
                                                                              uploader,
                                                                              bottom,
-                                                                             &op->render.node->bounds,
+                                                                             &bottom->bounds,
                                                                              clip,
                                                                              &op->render.source2_rect);
+            op->render.source2_rect.origin.x = (bounds->origin.x - 
bottom->bounds.origin.x)/bottom->bounds.size.width;
+            op->render.source2_rect.origin.y = (bounds->origin.y - 
bottom->bounds.origin.y)/bottom->bounds.size.height;
+            op->render.source2_rect.size.width = bounds->size.width / bottom->bounds.size.width;
+            op->render.source2_rect.size.height = bounds->size.height / bottom->bounds.size.height;
           }
           break;
 


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