gtk2/gsk/gskvulkanpipelineprivate.h
Matthias Clasen b0e8d8483d More work on text nodes
This commit takes several steps towards rendering text
like we want to.

The creation of the cairo surface and texture is moved
to the backend (in GskVulkanRenderer). We add a mask
shader that is used in the next text pipeline to use
the texture as a mask, like cairo_mask_surface does.
There is a separate color text pipeline that uses the
already existing blend shaders to use the texture as
a source, like cairo_paint does.

The text node api is simplified to have just a single
offset, which determines the left end of the text baseline,
like all our other text drawing APIs.
2017-09-10 14:36:26 -04:00

63 lines
3.0 KiB
C

#ifndef __GSK_VULKAN_PIPELINE_PRIVATE_H__
#define __GSK_VULKAN_PIPELINE_PRIVATE_H__
#include <gdk/gdk.h>
#include "gskdebugprivate.h"
G_BEGIN_DECLS
typedef struct _GskVulkanPipelineLayout GskVulkanPipelineLayout;
#define GSK_TYPE_VULKAN_PIPELINE (gsk_vulkan_pipeline_get_type ())
G_DECLARE_DERIVABLE_TYPE (GskVulkanPipeline, gsk_vulkan_pipeline, GSK, VULKAN_PIPELINE, GObject)
struct _GskVulkanPipelineClass
{
GObjectClass parent_class;
const VkPipelineVertexInputStateCreateInfo *
(* get_input_state_create_info) (GskVulkanPipeline *self);
};
static inline VkResult
gsk_vulkan_handle_result (VkResult res,
const char *called_function)
{
if (res != VK_SUCCESS)
{
GSK_NOTE (VULKAN,g_printerr ("%s(): %s (%d)\n", called_function, gdk_vulkan_strerror (res), res));
}
return res;
}
#define GSK_VK_CHECK(func, ...) gsk_vulkan_handle_result (func (__VA_ARGS__), G_STRINGIFY (func))
GskVulkanPipelineLayout * gsk_vulkan_pipeline_layout_new (GdkVulkanContext *context);
GskVulkanPipelineLayout * gsk_vulkan_pipeline_layout_ref (GskVulkanPipelineLayout *self);
void gsk_vulkan_pipeline_layout_unref (GskVulkanPipelineLayout *self);
VkPipelineLayout gsk_vulkan_pipeline_layout_get_pipeline_layout
(GskVulkanPipelineLayout *self);
VkDescriptorSetLayout gsk_vulkan_pipeline_layout_get_descriptor_set_layout
(GskVulkanPipelineLayout *self);
GskVulkanPipeline * gsk_vulkan_pipeline_new (GType pipeline_type,
GskVulkanPipelineLayout *layout,
const char *shader_name,
VkRenderPass render_pass);
GskVulkanPipeline * gsk_vulkan_pipeline_new_full (GType pipeline_type,
GskVulkanPipelineLayout *layout,
const char *shader_name,
VkRenderPass render_pass,
VkBlendFactor srcBlendFactor,
VkBlendFactor dstBlendFactor);
VkPipeline gsk_vulkan_pipeline_get_pipeline (GskVulkanPipeline *self);
G_END_DECLS
#endif /* __GSK_VULKAN_PIPELINE_PRIVATE_H__ */