[gtk+/wip/matthiasc/text-node] Fix the mask renderer



commit 36001547f5ce44c0fb262fdd49c7f20f9dfc5ef8
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Sep 9 22:59:29 2017 -0400

    Fix the mask renderer

 gsk/gskrendernodeimpl.c                         |    6 ++++++
 gsk/gskvulkanrenderpass.c                       |    6 +++++-
 gsk/resources/vulkan/mask-clip-rounded.frag.spv |  Bin 8392 -> 8508 bytes
 gsk/resources/vulkan/mask-clip.frag.spv         |  Bin 1484 -> 1600 bytes
 gsk/resources/vulkan/mask.frag                  |    2 +-
 gsk/resources/vulkan/mask.frag.spv              |  Bin 1484 -> 1600 bytes
 6 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index c1b09c8..d61256c 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -4155,6 +4155,8 @@ gsk_text_node_get_surface (GskRenderNode *node)
 {
   GskTextNode *self = (GskTextNode *) node;
 
+  g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_TEXT_NODE), NULL);
+
   return self->surface;
 }
 
@@ -4163,6 +4165,8 @@ gsk_text_node_get_has_color (GskRenderNode *node)
 {
   GskTextNode *self = (GskTextNode *) node;
 
+  g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_TEXT_NODE), FALSE);
+
   return self->has_color;
 }
 
@@ -4171,6 +4175,8 @@ gsk_text_node_get_color (GskRenderNode *node)
 {
   GskTextNode *self = (GskTextNode *) node;
 
+  g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_TEXT_NODE), NULL);
+
   return &self->color;
 }
 
diff --git a/gsk/gskvulkanrenderpass.c b/gsk/gskvulkanrenderpass.c
index 267c3b5..65de1cc 100644
--- a/gsk/gskvulkanrenderpass.c
+++ b/gsk/gskvulkanrenderpass.c
@@ -657,12 +657,16 @@ gsk_vulkan_render_pass_count_vertex_data (GskVulkanRenderPass *self)
         case GSK_VULKAN_OP_FALLBACK_CLIP:
         case GSK_VULKAN_OP_FALLBACK_ROUNDED_CLIP:
         case GSK_VULKAN_OP_SURFACE:
-        case GSK_VULKAN_OP_SURFACE_MASK:
         case GSK_VULKAN_OP_TEXTURE:
           op->render.vertex_count = gsk_vulkan_blend_pipeline_count_vertex_data (GSK_VULKAN_BLEND_PIPELINE 
(op->render.pipeline));
           n_bytes += op->render.vertex_count;
           break;
 
+        case GSK_VULKAN_OP_SURFACE_MASK:
+          op->render.vertex_count = gsk_vulkan_mask_pipeline_count_vertex_data (GSK_VULKAN_MASK_PIPELINE 
(op->render.pipeline));
+          n_bytes += op->render.vertex_count;
+          break;
+
         case GSK_VULKAN_OP_COLOR:
           op->render.vertex_count = gsk_vulkan_color_pipeline_count_vertex_data (GSK_VULKAN_COLOR_PIPELINE 
(op->render.pipeline));
           n_bytes += op->render.vertex_count;
diff --git a/gsk/resources/vulkan/mask-clip-rounded.frag.spv b/gsk/resources/vulkan/mask-clip-rounded.frag.spv
index 83c9444..0791cb5 100644
Binary files a/gsk/resources/vulkan/mask-clip-rounded.frag.spv and 
b/gsk/resources/vulkan/mask-clip-rounded.frag.spv differ
diff --git a/gsk/resources/vulkan/mask-clip.frag.spv b/gsk/resources/vulkan/mask-clip.frag.spv
index 7751f01..85fc5f0 100644
Binary files a/gsk/resources/vulkan/mask-clip.frag.spv and b/gsk/resources/vulkan/mask-clip.frag.spv differ
diff --git a/gsk/resources/vulkan/mask.frag b/gsk/resources/vulkan/mask.frag
index aca9b4d..f713371 100644
--- a/gsk/resources/vulkan/mask.frag
+++ b/gsk/resources/vulkan/mask.frag
@@ -12,5 +12,5 @@ layout(location = 0) out vec4 color;
 
 void main()
 {
-  color = clip (inPos, inColor * texture (inTexture, inTexCoord).a);
+  color = clip (inPos, vec4(inColor.rgb, texture(inTexture, inTexCoord).a));
 }
diff --git a/gsk/resources/vulkan/mask.frag.spv b/gsk/resources/vulkan/mask.frag.spv
index 7751f01..85fc5f0 100644
Binary files a/gsk/resources/vulkan/mask.frag.spv and b/gsk/resources/vulkan/mask.frag.spv differ


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