More work on text nodes

Desktop / GNOME / GTK - Matthias Clasen [redhat.com] - 10 September 2017 14:36 EDT

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.

b0e8d84 More work on text nodes
gsk/gskprivate.c | 20 +++
gsk/gskprivate.h | 3 +
gsk/gskrendernode.h | 6 +-
gsk/gskrendernodeimpl.c | 154 ++++++++++----------
gsk/gskrendernodeprivate.h | 6 +
gsk/gskvulkancolortextpipeline.c | 161 +++++++++++++++++++++
gsk/gskvulkancolortextpipelineprivate.h | 38 +++++
gsk/gskvulkanpipeline.c | 21 ++-
gsk/gskvulkanpipelineprivate.h | 6 +
gsk/gskvulkanrender.c | 10 +-
gsk/gskvulkanrenderer.c | 141 +++++++++++++++++++
gsk/gskvulkanrendererprivate.h | 14 ++
gsk/gskvulkanrenderpass.c | 180 +++++++++++++++++++++++-
gsk/gskvulkanrenderpassprivate.h | 1 +
gsk/gskvulkanrenderprivate.h | 6 +
gsk/gskvulkantextpipeline.c | 173 +++++++++++++++++++++++
gsk/gskvulkantextpipelineprivate.h | 39 +++++
gsk/meson.build | 2 +
gsk/resources/vulkan/mask-clip-rounded.frag.spv | Bin 0 -> 8508 bytes
gsk/resources/vulkan/mask-clip-rounded.vert.spv | Bin 0 -> 5016 bytes
gsk/resources/vulkan/mask-clip.frag.spv | Bin 0 -> 1600 bytes
gsk/resources/vulkan/mask-clip.vert.spv | Bin 0 -> 5016 bytes
gsk/resources/vulkan/mask.frag | 16 +++
gsk/resources/vulkan/mask.frag.spv | Bin 0 -> 1600 bytes
gsk/resources/vulkan/mask.vert | 38 +++++
gsk/resources/vulkan/mask.vert.spv | Bin 0 -> 3284 bytes
gsk/resources/vulkan/meson.build | 2 +
gtk/gskpango.c | 8 +-
28 files changed, 954 insertions(+), 91 deletions(-)

Upstream: git.gnome.org


  • Share