[gtk/pango2-windows: 8/10] GSK Vulkan: WIP port to Pango2
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/pango2-windows: 8/10] GSK Vulkan: WIP port to Pango2
- Date: Fri, 8 Jul 2022 03:57:09 +0000 (UTC)
commit a98c922eea64bf44da41e9720426ab3187530b60
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Jul 6 11:24:28 2022 +0800
GSK Vulkan: WIP port to Pango2
gsk/vulkan/gskvulkancolortextpipeline.c | 12 ++++++------
gsk/vulkan/gskvulkancolortextpipelineprivate.h | 4 ++--
gsk/vulkan/gskvulkanglyphcache.c | 24 ++++++++++++------------
gsk/vulkan/gskvulkanglyphcacheprivate.h | 4 ++--
gsk/vulkan/gskvulkanrenderer.c | 8 ++++----
gsk/vulkan/gskvulkanrendererprivate.h | 8 ++++----
gsk/vulkan/gskvulkanrenderpass.c | 12 ++++++------
gsk/vulkan/gskvulkantextpipeline.c | 12 ++++++------
gsk/vulkan/gskvulkantextpipelineprivate.h | 4 ++--
9 files changed, 44 insertions(+), 44 deletions(-)
---
diff --git a/gsk/vulkan/gskvulkancolortextpipeline.c b/gsk/vulkan/gskvulkancolortextpipeline.c
index 5ffe62adcc..baeeac222c 100644
--- a/gsk/vulkan/gskvulkancolortextpipeline.c
+++ b/gsk/vulkan/gskvulkancolortextpipeline.c
@@ -97,9 +97,9 @@ gsk_vulkan_color_text_pipeline_collect_vertex_data (GskVulkanColorTextPipeline *
guchar *data,
GskVulkanRenderer *renderer,
const graphene_rect_t *rect,
- PangoFont *font,
+ Pango2Font *font,
guint total_glyphs,
- const PangoGlyphInfo *glyphs,
+ const Pango2GlyphInfo *glyphs,
const graphene_point_t *offset,
guint start_glyph,
guint num_glyphs,
@@ -115,12 +115,12 @@ gsk_vulkan_color_text_pipeline_collect_vertex_data (GskVulkanColorTextPipeline *
for (; i < total_glyphs && count < num_glyphs; i++)
{
- const PangoGlyphInfo *gi = &glyphs[i];
+ const Pango2GlyphInfo *gi = &glyphs[i];
- if (gi->glyph != PANGO_GLYPH_EMPTY)
+ if (gi->glyph != PANGO2_GLYPH_EMPTY)
{
- double cx = (x_position + gi->geometry.x_offset) / PANGO_SCALE;
- double cy = gi->geometry.y_offset / PANGO_SCALE;
+ double cx = (x_position + gi->geometry.x_offset) / PANGO2_SCALE;
+ double cy = gi->geometry.y_offset / PANGO2_SCALE;
GskVulkanColorTextInstance *instance = &instances[count];
GskVulkanCachedGlyph *glyph;
diff --git a/gsk/vulkan/gskvulkancolortextpipelineprivate.h b/gsk/vulkan/gskvulkancolortextpipelineprivate.h
index a549c25fcd..b3551dad1c 100644
--- a/gsk/vulkan/gskvulkancolortextpipelineprivate.h
+++ b/gsk/vulkan/gskvulkancolortextpipelineprivate.h
@@ -25,9 +25,9 @@ void gsk_vulkan_color_text_pipeline_collect_vertex_data (Gs
guchar
*data,
GskVulkanRenderer
*renderer,
const graphene_rect_t
*rect,
- PangoFont
*font,
+ Pango2Font
*font,
guint
total_glyphs,
- const PangoGlyphInfo
*glyphs,
+ const Pango2GlyphInfo
*glyphs,
const graphene_point_t
*offset,
guint
start_glyph,
guint
num_glyphs,
diff --git a/gsk/vulkan/gskvulkanglyphcache.c b/gsk/vulkan/gskvulkanglyphcache.c
index 830b4d70c9..53c1219c79 100644
--- a/gsk/vulkan/gskvulkanglyphcache.c
+++ b/gsk/vulkan/gskvulkanglyphcache.c
@@ -113,8 +113,8 @@ gsk_vulkan_glyph_cache_class_init (GskVulkanGlyphCacheClass *klass)
}
typedef struct {
- PangoFont *font;
- PangoGlyph glyph;
+ Pango2Font *font;
+ Pango2Glyph glyph;
guint xshift;
guint yshift;
guint scale; /* times 1024 */
@@ -257,8 +257,8 @@ render_glyph (Atlas *atlas,
GskVulkanCachedGlyph *value = glyph->value;
cairo_surface_t *surface;
cairo_t *cr;
- PangoGlyphString glyphs;
- PangoGlyphInfo gi;
+ Pango2GlyphString glyphs;
+ Pango2GlyphInfo gi;
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
value->draw_width * key->scale / 1024,
@@ -270,7 +270,7 @@ render_glyph (Atlas *atlas,
gi.glyph = key->glyph;
gi.geometry.width = value->draw_width * 1024;
- if (key->glyph & PANGO_GLYPH_UNKNOWN_FLAG)
+ if (key->glyph & PANGO2_GLYPH_UNKNOWN_FLAG)
gi.geometry.x_offset = key->xshift * 256;
else
gi.geometry.x_offset = key->xshift * 256 - value->draw_x * 1024;
@@ -279,7 +279,7 @@ render_glyph (Atlas *atlas,
glyphs.num_glyphs = 1;
glyphs.glyphs = &gi;
- pango_cairo_show_glyph_string (cr, key->font, &glyphs);
+ pango2_cairo_show_glyph_string (cr, key->font, &glyphs);
cairo_destroy (cr);
@@ -332,13 +332,13 @@ gsk_vulkan_glyph_cache_new (GskRenderer *renderer,
return cache;
}
-#define PHASE(x) ((x % PANGO_SCALE) * 4 / PANGO_SCALE)
+#define PHASE(x) ((x % PANGO2_SCALE) * 4 / PANGO2_SCALE)
GskVulkanCachedGlyph *
gsk_vulkan_glyph_cache_lookup (GskVulkanGlyphCache *cache,
gboolean create,
- PangoFont *font,
- PangoGlyph glyph,
+ Pango2Font *font,
+ Pango2Glyph glyph,
int x,
int y,
float scale)
@@ -373,13 +373,13 @@ gsk_vulkan_glyph_cache_lookup (GskVulkanGlyphCache *cache,
if (create && value == NULL)
{
GlyphCacheKey *key;
- PangoRectangle ink_rect;
+ Pango2Rectangle ink_rect;
key = g_new (GlyphCacheKey, 1);
value = g_new0 (GskVulkanCachedGlyph, 1);
- pango_font_get_glyph_extents (font, glyph, &ink_rect, NULL);
- pango_extents_to_pixels (&ink_rect, NULL);
+ pango2_font_get_glyph_extents (font, glyph, &ink_rect, NULL);
+ pango2_extents_to_pixels (&ink_rect, NULL);
value->draw_x = ink_rect.x;
value->draw_y = ink_rect.y;
diff --git a/gsk/vulkan/gskvulkanglyphcacheprivate.h b/gsk/vulkan/gskvulkanglyphcacheprivate.h
index c6274cbbf1..ad390ef9b7 100644
--- a/gsk/vulkan/gskvulkanglyphcacheprivate.h
+++ b/gsk/vulkan/gskvulkanglyphcacheprivate.h
@@ -20,8 +20,8 @@ GskVulkanImage * gsk_vulkan_glyph_cache_get_glyph_image (GskVulkanGlyphCache
GskVulkanCachedGlyph *gsk_vulkan_glyph_cache_lookup (GskVulkanGlyphCache *cache,
gboolean create,
- PangoFont *font,
- PangoGlyph glyph,
+ Pango2Font *font,
+ Pango2Glyph glyph,
int x,
int y,
diff --git a/gsk/vulkan/gskvulkanrenderer.c b/gsk/vulkan/gskvulkanrenderer.c
index 86f7984805..d1ff0218f3 100644
--- a/gsk/vulkan/gskvulkanrenderer.c
+++ b/gsk/vulkan/gskvulkanrenderer.c
@@ -378,8 +378,8 @@ gsk_vulkan_renderer_ref_glyph_image (GskVulkanRenderer *self,
guint
gsk_vulkan_renderer_cache_glyph (GskVulkanRenderer *self,
- PangoFont *font,
- PangoGlyph glyph,
+ Pango2Font *font,
+ Pango2Glyph glyph,
int x,
int y,
float scale)
@@ -389,8 +389,8 @@ gsk_vulkan_renderer_cache_glyph (GskVulkanRenderer *self,
GskVulkanCachedGlyph *
gsk_vulkan_renderer_get_cached_glyph (GskVulkanRenderer *self,
- PangoFont *font,
- PangoGlyph glyph,
+ Pango2Font *font,
+ Pango2Glyph glyph,
int x,
int y,
float scale)
diff --git a/gsk/vulkan/gskvulkanrendererprivate.h b/gsk/vulkan/gskvulkanrendererprivate.h
index eca34ccabd..b683e43012 100644
--- a/gsk/vulkan/gskvulkanrendererprivate.h
+++ b/gsk/vulkan/gskvulkanrendererprivate.h
@@ -28,8 +28,8 @@ typedef struct
} GskVulkanCachedGlyph;
guint gsk_vulkan_renderer_cache_glyph (GskVulkanRenderer *renderer,
- PangoFont *font,
- PangoGlyph glyph,
+ Pango2Font *font,
+ Pango2Glyph glyph,
int x,
int y,
float scale);
@@ -39,8 +39,8 @@ GskVulkanImage * gsk_vulkan_renderer_ref_glyph_image (GskVulkanRenderer *
guint index);
GskVulkanCachedGlyph * gsk_vulkan_renderer_get_cached_glyph (GskVulkanRenderer *self,
- PangoFont *font,
- PangoGlyph glyph,
+ Pango2Font *font,
+ Pango2Glyph glyph,
int x,
int y,
float scale);
diff --git a/gsk/vulkan/gskvulkanrenderpass.c b/gsk/vulkan/gskvulkanrenderpass.c
index 34b035245a..2fe6b72690 100644
--- a/gsk/vulkan/gskvulkanrenderpass.c
+++ b/gsk/vulkan/gskvulkanrenderpass.c
@@ -348,8 +348,8 @@ gsk_vulkan_render_pass_add_node (GskVulkanRenderPass *self,
case GSK_TEXT_NODE:
{
- const PangoFont *font = gsk_text_node_get_font (node);
- const PangoGlyphInfo *glyphs = gsk_text_node_get_glyphs (node, NULL);
+ const Pango2Font *font = gsk_text_node_get_font (node);
+ const Pango2GlyphInfo *glyphs = gsk_text_node_get_glyphs (node, NULL);
guint num_glyphs = gsk_text_node_get_num_glyphs (node);
gboolean has_color_glyphs = gsk_text_node_has_color_glyphs (node);
int i;
@@ -391,10 +391,10 @@ gsk_vulkan_render_pass_add_node (GskVulkanRenderPass *self,
x_position = 0;
for (i = 0, count = 0; i < num_glyphs; i++)
{
- const PangoGlyphInfo *gi = &glyphs[i];
+ const Pango2GlyphInfo *gi = &glyphs[i];
texture_index = gsk_vulkan_renderer_cache_glyph (renderer,
- (PangoFont *)font,
+ (Pango2Font *)font,
gi->glyph,
x_position + gi->geometry.x_offset,
gi->geometry.y_offset,
@@ -1215,7 +1215,7 @@ gsk_vulkan_render_pass_collect_vertex_data (GskVulkanRenderPass *self,
data + n_bytes + offset,
GSK_VULKAN_RENDERER
(gsk_vulkan_render_get_renderer (render)),
&op->text.node->bounds,
- (PangoFont *)gsk_text_node_get_font
(op->text.node),
+ (Pango2Font *)gsk_text_node_get_font
(op->text.node),
gsk_text_node_get_num_glyphs (op->text.node),
gsk_text_node_get_glyphs (op->text.node, NULL),
gsk_text_node_get_color (op->text.node),
@@ -1234,7 +1234,7 @@ gsk_vulkan_render_pass_collect_vertex_data (GskVulkanRenderPass *self,
data + n_bytes + offset,
GSK_VULKAN_RENDERER
(gsk_vulkan_render_get_renderer (render)),
&op->text.node->bounds,
- (PangoFont *)gsk_text_node_get_font
(op->text.node),
+ (Pango2Font *)gsk_text_node_get_font
(op->text.node),
gsk_text_node_get_num_glyphs (op->text.node),
gsk_text_node_get_glyphs (op->text.node,
NULL),
gsk_text_node_get_offset (op->text.node),
diff --git a/gsk/vulkan/gskvulkantextpipeline.c b/gsk/vulkan/gskvulkantextpipeline.c
index 9544c6a7c7..47dc82fa6b 100644
--- a/gsk/vulkan/gskvulkantextpipeline.c
+++ b/gsk/vulkan/gskvulkantextpipeline.c
@@ -104,9 +104,9 @@ gsk_vulkan_text_pipeline_collect_vertex_data (GskVulkanTextPipeline *pipeline,
guchar *data,
GskVulkanRenderer *renderer,
const graphene_rect_t *rect,
- PangoFont *font,
+ Pango2Font *font,
guint total_glyphs,
- const PangoGlyphInfo *glyphs,
+ const Pango2GlyphInfo *glyphs,
const GdkRGBA *color,
const graphene_point_t *offset,
guint start_glyph,
@@ -123,12 +123,12 @@ gsk_vulkan_text_pipeline_collect_vertex_data (GskVulkanTextPipeline *pipeline,
for (; i < total_glyphs && count < num_glyphs; i++)
{
- const PangoGlyphInfo *gi = &glyphs[i];
+ const Pango2GlyphInfo *gi = &glyphs[i];
- if (gi->glyph != PANGO_GLYPH_EMPTY)
+ if (gi->glyph != PANGO2_GLYPH_EMPTY)
{
- double cx = (x_position + gi->geometry.x_offset) / PANGO_SCALE;
- double cy = gi->geometry.y_offset / PANGO_SCALE;
+ double cx = (x_position + gi->geometry.x_offset) / PANGO2_SCALE;
+ double cy = gi->geometry.y_offset / PANGO2_SCALE;
GskVulkanTextInstance *instance = &instances[count];
GskVulkanCachedGlyph *glyph;
diff --git a/gsk/vulkan/gskvulkantextpipelineprivate.h b/gsk/vulkan/gskvulkantextpipelineprivate.h
index c186c4d983..4d716cc962 100644
--- a/gsk/vulkan/gskvulkantextpipelineprivate.h
+++ b/gsk/vulkan/gskvulkantextpipelineprivate.h
@@ -25,9 +25,9 @@ void gsk_vulkan_text_pipeline_collect_vertex_data (GskVulka
guchar *data,
GskVulkanRenderer
*renderer,
const graphene_rect_t *rect,
- PangoFont *font,
+ Pango2Font *font,
guint
total_glyphs,
- const PangoGlyphInfo
*glyphs,
+ const Pango2GlyphInfo
*glyphs,
const GdkRGBA
*color,
const graphene_point_t
*offset,
guint
start_glyph,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]