[gtk+/wip/matthiasc/text-node] Rename mask pipeline to text pipeline
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/matthiasc/text-node] Rename mask pipeline to text pipeline
- Date: Sun, 10 Sep 2017 14:05:38 +0000 (UTC)
commit e4b58351854190b8ce195fb6531061a588d54b9b
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Sep 10 07:52:22 2017 -0400
Rename mask pipeline to text pipeline
It will become text-specific when we move to using one
instance per glyph, so rename it already.
gsk/gskvulkanrender.c | 8 ++--
gsk/gskvulkanrenderpass.c | 14 +++---
gsk/gskvulkanrenderprivate.h | 6 +-
...ulkanmaskpipeline.c => gskvulkantextpipeline.c} | 48 ++++++++++----------
...ineprivate.h => gskvulkantextpipelineprivate.h} | 20 ++++----
gsk/meson.build | 2 +-
6 files changed, 49 insertions(+), 49 deletions(-)
---
diff --git a/gsk/gskvulkanrender.c b/gsk/gskvulkanrender.c
index 0c63f38..2f2ec4a 100644
--- a/gsk/gskvulkanrender.c
+++ b/gsk/gskvulkanrender.c
@@ -17,7 +17,7 @@
#include "gskvulkancolorpipelineprivate.h"
#include "gskvulkaneffectpipelineprivate.h"
#include "gskvulkanlineargradientpipelineprivate.h"
-#include "gskvulkanmaskpipelineprivate.h"
+#include "gskvulkantextpipelineprivate.h"
#define ORTHO_NEAR_PLANE -10000
#define ORTHO_FAR_PLANE 10000
@@ -345,9 +345,9 @@ gsk_vulkan_render_get_pipeline (GskVulkanRender *self,
{ "blur", gsk_vulkan_blur_pipeline_new },
{ "blur-clip", gsk_vulkan_blur_pipeline_new },
{ "blur-clip-rounded", gsk_vulkan_blur_pipeline_new },
- { "mask", gsk_vulkan_mask_pipeline_new },
- { "mask-clip", gsk_vulkan_mask_pipeline_new },
- { "mask-clip-rounded", gsk_vulkan_mask_pipeline_new },
+ { "mask", gsk_vulkan_text_pipeline_new },
+ { "mask-clip", gsk_vulkan_text_pipeline_new },
+ { "mask-clip-rounded", gsk_vulkan_text_pipeline_new },
};
g_return_val_if_fail (type < GSK_VULKAN_N_PIPELINES, NULL);
diff --git a/gsk/gskvulkanrenderpass.c b/gsk/gskvulkanrenderpass.c
index 65de1cc..2bd7ce2 100644
--- a/gsk/gskvulkanrenderpass.c
+++ b/gsk/gskvulkanrenderpass.c
@@ -14,7 +14,7 @@
#include "gskvulkancolorpipelineprivate.h"
#include "gskvulkaneffectpipelineprivate.h"
#include "gskvulkanlineargradientpipelineprivate.h"
-#include "gskvulkanmaskpipelineprivate.h"
+#include "gskvulkantextpipelineprivate.h"
#include "gskvulkanimageprivate.h"
#include "gskvulkanpushconstantsprivate.h"
#include "gskvulkanrendererprivate.h"
@@ -192,11 +192,11 @@ gsk_vulkan_render_pass_add_node (GskVulkanRenderPass *self,
else
{
if (gsk_vulkan_clip_contains_rect (&constants->clip, &node->bounds))
- pipeline_type = GSK_VULKAN_PIPELINE_MASK;
+ pipeline_type = GSK_VULKAN_PIPELINE_TEXT;
else if (constants->clip.type == GSK_VULKAN_CLIP_RECT)
- pipeline_type = GSK_VULKAN_PIPELINE_MASK_CLIP;
+ pipeline_type = GSK_VULKAN_PIPELINE_TEXT_CLIP;
else if (constants->clip.type == GSK_VULKAN_CLIP_ROUNDED_CIRCULAR)
- pipeline_type = GSK_VULKAN_PIPELINE_MASK_CLIP_ROUNDED;
+ pipeline_type = GSK_VULKAN_PIPELINE_TEXT_CLIP_ROUNDED;
else
FALLBACK ("Text nodes can't deal with clip type %u\n", constants->clip.type);
op.type = GSK_VULKAN_OP_SURFACE_MASK;
@@ -663,7 +663,7 @@ gsk_vulkan_render_pass_count_vertex_data (GskVulkanRenderPass *self)
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));
+ op->render.vertex_count = gsk_vulkan_text_pipeline_count_vertex_data (GSK_VULKAN_TEXT_PIPELINE
(op->render.pipeline));
n_bytes += op->render.vertex_count;
break;
@@ -743,7 +743,7 @@ gsk_vulkan_render_pass_collect_vertex_data (GskVulkanRenderPass *self,
case GSK_VULKAN_OP_SURFACE_MASK:
{
op->render.vertex_offset = offset + n_bytes;
- gsk_vulkan_mask_pipeline_collect_vertex_data (GSK_VULKAN_MASK_PIPELINE (op->render.pipeline),
+ gsk_vulkan_text_pipeline_collect_vertex_data (GSK_VULKAN_TEXT_PIPELINE (op->render.pipeline),
data + n_bytes + offset,
&op->render.node->bounds,
gsk_text_node_get_color (op->render.node));
@@ -998,7 +998,7 @@ gsk_vulkan_render_pass_draw (GskVulkanRenderPass *self,
0,
NULL);
- current_draw_index += gsk_vulkan_mask_pipeline_draw (GSK_VULKAN_MASK_PIPELINE (current_pipeline),
+ current_draw_index += gsk_vulkan_text_pipeline_draw (GSK_VULKAN_TEXT_PIPELINE (current_pipeline),
command_buffer,
current_draw_index, 1);
break;
diff --git a/gsk/gskvulkanrenderprivate.h b/gsk/gskvulkanrenderprivate.h
index 3b910e2..7900d13 100644
--- a/gsk/gskvulkanrenderprivate.h
+++ b/gsk/gskvulkanrenderprivate.h
@@ -34,9 +34,9 @@ typedef enum {
GSK_VULKAN_PIPELINE_BLUR,
GSK_VULKAN_PIPELINE_BLUR_CLIP,
GSK_VULKAN_PIPELINE_BLUR_CLIP_ROUNDED,
- GSK_VULKAN_PIPELINE_MASK,
- GSK_VULKAN_PIPELINE_MASK_CLIP,
- GSK_VULKAN_PIPELINE_MASK_CLIP_ROUNDED,
+ GSK_VULKAN_PIPELINE_TEXT,
+ GSK_VULKAN_PIPELINE_TEXT_CLIP,
+ GSK_VULKAN_PIPELINE_TEXT_CLIP_ROUNDED,
/* add more */
GSK_VULKAN_N_PIPELINES
} GskVulkanPipelineType;
diff --git a/gsk/gskvulkanmaskpipeline.c b/gsk/gskvulkantextpipeline.c
similarity index 67%
rename from gsk/gskvulkanmaskpipeline.c
rename to gsk/gskvulkantextpipeline.c
index 32e194f..7f504ee 100644
--- a/gsk/gskvulkanmaskpipeline.c
+++ b/gsk/gskvulkantextpipeline.c
@@ -1,30 +1,30 @@
#include "config.h"
-#include "gskvulkanmaskpipelineprivate.h"
+#include "gskvulkantextpipelineprivate.h"
-struct _GskVulkanMaskPipeline
+struct _GskVulkanTextPipeline
{
GObject parent_instance;
};
-typedef struct _GskVulkanMaskInstance GskVulkanMaskInstance;
+typedef struct _GskVulkanTextInstance GskVulkanTextInstance;
-struct _GskVulkanMaskInstance
+struct _GskVulkanTextInstance
{
float rect[4];
float tex_rect[4];
float color[4];
};
-G_DEFINE_TYPE (GskVulkanMaskPipeline, gsk_vulkan_mask_pipeline, GSK_TYPE_VULKAN_PIPELINE)
+G_DEFINE_TYPE (GskVulkanTextPipeline, gsk_vulkan_text_pipeline, GSK_TYPE_VULKAN_PIPELINE)
static const VkPipelineVertexInputStateCreateInfo *
-gsk_vulkan_mask_pipeline_get_input_state_create_info (GskVulkanPipeline *self)
+gsk_vulkan_text_pipeline_get_input_state_create_info (GskVulkanPipeline *self)
{
static const VkVertexInputBindingDescription vertexBindingDescriptions[] = {
{
.binding = 0,
- .stride = sizeof (GskVulkanMaskInstance),
+ .stride = sizeof (GskVulkanTextInstance),
.inputRate = VK_VERTEX_INPUT_RATE_INSTANCE
}
};
@@ -33,19 +33,19 @@ gsk_vulkan_mask_pipeline_get_input_state_create_info (GskVulkanPipeline *self)
.location = 0,
.binding = 0,
.format = VK_FORMAT_R32G32B32A32_SFLOAT,
- .offset = G_STRUCT_OFFSET (GskVulkanMaskInstance, rect),
+ .offset = G_STRUCT_OFFSET (GskVulkanTextInstance, rect),
},
{
.location = 1,
.binding = 0,
.format = VK_FORMAT_R32G32B32A32_SFLOAT,
- .offset = G_STRUCT_OFFSET (GskVulkanMaskInstance, tex_rect),
+ .offset = G_STRUCT_OFFSET (GskVulkanTextInstance, tex_rect),
},
{
.location = 2,
.binding = 0,
.format = VK_FORMAT_R32G32B32A32_SFLOAT,
- .offset = G_STRUCT_OFFSET (GskVulkanMaskInstance, color),
+ .offset = G_STRUCT_OFFSET (GskVulkanTextInstance, color),
}
};
static const VkPipelineVertexInputStateCreateInfo info = {
@@ -60,50 +60,50 @@ gsk_vulkan_mask_pipeline_get_input_state_create_info (GskVulkanPipeline *self)
}
static void
-gsk_vulkan_mask_pipeline_finalize (GObject *gobject)
+gsk_vulkan_text_pipeline_finalize (GObject *gobject)
{
- //GskVulkanMaskPipeline *self = GSK_VULKAN_MASK_PIPELINE (gobject);
+ //GskVulkanTextPipeline *self = GSK_VULKAN_TEXT_PIPELINE (gobject);
- G_OBJECT_CLASS (gsk_vulkan_mask_pipeline_parent_class)->finalize (gobject);
+ G_OBJECT_CLASS (gsk_vulkan_text_pipeline_parent_class)->finalize (gobject);
}
static void
-gsk_vulkan_mask_pipeline_class_init (GskVulkanMaskPipelineClass *klass)
+gsk_vulkan_text_pipeline_class_init (GskVulkanTextPipelineClass *klass)
{
GskVulkanPipelineClass *pipeline_class = GSK_VULKAN_PIPELINE_CLASS (klass);
- G_OBJECT_CLASS (klass)->finalize = gsk_vulkan_mask_pipeline_finalize;
+ G_OBJECT_CLASS (klass)->finalize = gsk_vulkan_text_pipeline_finalize;
- pipeline_class->get_input_state_create_info = gsk_vulkan_mask_pipeline_get_input_state_create_info;
+ pipeline_class->get_input_state_create_info = gsk_vulkan_text_pipeline_get_input_state_create_info;
}
static void
-gsk_vulkan_mask_pipeline_init (GskVulkanMaskPipeline *self)
+gsk_vulkan_text_pipeline_init (GskVulkanTextPipeline *self)
{
}
GskVulkanPipeline *
-gsk_vulkan_mask_pipeline_new (GskVulkanPipelineLayout *layout,
+gsk_vulkan_text_pipeline_new (GskVulkanPipelineLayout *layout,
const char *shader_name,
VkRenderPass render_pass)
{
- return gsk_vulkan_pipeline_new_full (GSK_TYPE_VULKAN_MASK_PIPELINE, layout, shader_name, render_pass,
+ return gsk_vulkan_pipeline_new_full (GSK_TYPE_VULKAN_TEXT_PIPELINE, layout, shader_name, render_pass,
VK_BLEND_FACTOR_SRC_ALPHA, VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA);
}
gsize
-gsk_vulkan_mask_pipeline_count_vertex_data (GskVulkanMaskPipeline *pipeline)
+gsk_vulkan_text_pipeline_count_vertex_data (GskVulkanTextPipeline *pipeline)
{
- return sizeof (GskVulkanMaskInstance);
+ return sizeof (GskVulkanTextInstance);
}
void
-gsk_vulkan_mask_pipeline_collect_vertex_data (GskVulkanMaskPipeline *pipeline,
+gsk_vulkan_text_pipeline_collect_vertex_data (GskVulkanTextPipeline *pipeline,
guchar *data,
const graphene_rect_t *rect,
const GdkRGBA *color)
{
- GskVulkanMaskInstance *instance = (GskVulkanMaskInstance *) data;
+ GskVulkanTextInstance *instance = (GskVulkanTextInstance *) data;
instance->rect[0] = rect->origin.x;
instance->rect[1] = rect->origin.y;
@@ -120,7 +120,7 @@ gsk_vulkan_mask_pipeline_collect_vertex_data (GskVulkanMaskPipeline *pipeline,
}
gsize
-gsk_vulkan_mask_pipeline_draw (GskVulkanMaskPipeline *pipeline,
+gsk_vulkan_text_pipeline_draw (GskVulkanTextPipeline *pipeline,
VkCommandBuffer command_buffer,
gsize offset,
gsize n_commands)
diff --git a/gsk/gskvulkanmaskpipelineprivate.h b/gsk/gskvulkantextpipelineprivate.h
similarity index 57%
rename from gsk/gskvulkanmaskpipelineprivate.h
rename to gsk/gskvulkantextpipelineprivate.h
index a91c1ca..6ebdcac 100644
--- a/gsk/gskvulkanmaskpipelineprivate.h
+++ b/gsk/gskvulkantextpipelineprivate.h
@@ -1,5 +1,5 @@
-#ifndef __GSK_VULKAN_MASK_PIPELINE_PRIVATE_H__
-#define __GSK_VULKAN_MASK_PIPELINE_PRIVATE_H__
+#ifndef __GSK_VULKAN_TEXT_PIPELINE_PRIVATE_H__
+#define __GSK_VULKAN_TEXT_PIPELINE_PRIVATE_H__
#include <graphene.h>
@@ -7,26 +7,26 @@
G_BEGIN_DECLS
-typedef struct _GskVulkanMaskPipelineLayout GskVulkanMaskPipelineLayout;
+typedef struct _GskVulkanTextPipelineLayout GskVulkanTextPipelineLayout;
-#define GSK_TYPE_VULKAN_MASK_PIPELINE (gsk_vulkan_mask_pipeline_get_type ())
+#define GSK_TYPE_VULKAN_TEXT_PIPELINE (gsk_vulkan_text_pipeline_get_type ())
-G_DECLARE_FINAL_TYPE (GskVulkanMaskPipeline, gsk_vulkan_mask_pipeline, GSK, VULKAN_MASK_PIPELINE,
GskVulkanPipeline)
+G_DECLARE_FINAL_TYPE (GskVulkanTextPipeline, gsk_vulkan_text_pipeline, GSK, VULKAN_TEXT_PIPELINE,
GskVulkanPipeline)
-GskVulkanPipeline * gsk_vulkan_mask_pipeline_new (GskVulkanPipelineLayout *
layout,
+GskVulkanPipeline * gsk_vulkan_text_pipeline_new (GskVulkanPipelineLayout *
layout,
const char
*shader_name,
VkRenderPass
render_pass);
-gsize gsk_vulkan_mask_pipeline_count_vertex_data (GskVulkanMaskPipeline
*pipeline);
-void gsk_vulkan_mask_pipeline_collect_vertex_data (GskVulkanMaskPipeline
*pipeline,
+gsize gsk_vulkan_text_pipeline_count_vertex_data (GskVulkanTextPipeline
*pipeline);
+void gsk_vulkan_text_pipeline_collect_vertex_data (GskVulkanTextPipeline
*pipeline,
guchar *data,
const graphene_rect_t *rect,
const GdkRGBA
*color);
-gsize gsk_vulkan_mask_pipeline_draw (GskVulkanMaskPipeline
*pipeline,
+gsize gsk_vulkan_text_pipeline_draw (GskVulkanTextPipeline
*pipeline,
VkCommandBuffer
command_buffer,
gsize
offset,
gsize
n_commands);
G_END_DECLS
-#endif /* __GSK_VULKAN_MASK_PIPELINE_PRIVATE_H__ */
+#endif /* __GSK_VULKAN_TEXT_PIPELINE_PRIVATE_H__ */
diff --git a/gsk/meson.build b/gsk/meson.build
index 7b74069..ff69b71 100644
--- a/gsk/meson.build
+++ b/gsk/meson.build
@@ -65,7 +65,7 @@ if have_vulkan
'gskvulkaneffectpipeline.c',
'gskvulkanlineargradientpipeline.c',
'gskvulkanimage.c',
- 'gskvulkanmaskpipeline.c',
+ 'gskvulkantextpipeline.c',
'gskvulkanmemory.c',
'gskvulkanpipeline.c',
'gskvulkanpushconstants.c',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]