mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
gsk: Tweak text node apis
Rename getters to follow the peek naming pattern. Update all callers.
This commit is contained in:
parent
243bd4f0c8
commit
04f6b26205
@ -293,11 +293,11 @@ GskRenderNode * gsk_text_node_new (PangoFont
|
||||
double x,
|
||||
double y);
|
||||
GDK_AVAILABLE_IN_3_94
|
||||
PangoFont * gsk_text_node_get_font (GskRenderNode *node);
|
||||
const PangoFont * gsk_text_node_peek_font (GskRenderNode *node);
|
||||
GDK_AVAILABLE_IN_3_94
|
||||
const PangoGlyphString *gsk_text_node_peek_glyphs (GskRenderNode *node);
|
||||
GDK_AVAILABLE_IN_3_94
|
||||
PangoGlyphString * gsk_text_node_get_glyphs (GskRenderNode *node);
|
||||
GDK_AVAILABLE_IN_3_94
|
||||
const GdkRGBA * gsk_text_node_get_color (GskRenderNode *node);
|
||||
const GdkRGBA * gsk_text_node_peek_color (GskRenderNode *node);
|
||||
GDK_AVAILABLE_IN_3_94
|
||||
float gsk_text_node_get_x (GskRenderNode *node);
|
||||
GDK_AVAILABLE_IN_3_94
|
||||
|
@ -4090,7 +4090,7 @@ gsk_text_node_new (PangoFont *font,
|
||||
}
|
||||
|
||||
const GdkRGBA *
|
||||
gsk_text_node_get_color (GskRenderNode *node)
|
||||
gsk_text_node_peek_color (GskRenderNode *node)
|
||||
{
|
||||
GskTextNode *self = (GskTextNode *) node;
|
||||
|
||||
@ -4099,8 +4099,8 @@ gsk_text_node_get_color (GskRenderNode *node)
|
||||
return &self->color;
|
||||
}
|
||||
|
||||
PangoFont *
|
||||
gsk_text_node_get_font (GskRenderNode *node)
|
||||
const PangoFont *
|
||||
gsk_text_node_peek_font (GskRenderNode *node)
|
||||
{
|
||||
GskTextNode *self = (GskTextNode *) node;
|
||||
|
||||
@ -4109,8 +4109,8 @@ gsk_text_node_get_font (GskRenderNode *node)
|
||||
return self->font;
|
||||
}
|
||||
|
||||
PangoGlyphString *
|
||||
gsk_text_node_get_glyphs (GskRenderNode *node)
|
||||
const PangoGlyphString *
|
||||
gsk_text_node_peek_glyphs (GskRenderNode *node)
|
||||
{
|
||||
GskTextNode *self = (GskTextNode *) node;
|
||||
|
||||
|
@ -236,7 +236,7 @@ gsk_vulkan_render_pass_free (GskVulkanRenderPass *self)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
font_has_color_glyphs (PangoFont *font)
|
||||
font_has_color_glyphs (const PangoFont *font)
|
||||
{
|
||||
cairo_scaled_font_t *scaled_font;
|
||||
gboolean has_color = FALSE;
|
||||
@ -370,8 +370,8 @@ gsk_vulkan_render_pass_add_node (GskVulkanRenderPass *self,
|
||||
|
||||
case GSK_TEXT_NODE:
|
||||
{
|
||||
PangoFont *font = gsk_text_node_get_font (node);
|
||||
PangoGlyphString *glyphs = gsk_text_node_get_glyphs (node);
|
||||
const PangoFont *font = gsk_text_node_peek_font (node);
|
||||
const PangoGlyphString *glyphs = gsk_text_node_peek_glyphs (node);
|
||||
int i;
|
||||
guint count;
|
||||
guint texture_index;
|
||||
@ -412,7 +412,7 @@ gsk_vulkan_render_pass_add_node (GskVulkanRenderPass *self,
|
||||
|
||||
if (gi->glyph != PANGO_GLYPH_EMPTY && !(gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG))
|
||||
{
|
||||
texture_index = gsk_vulkan_renderer_cache_glyph (renderer, font, gi->glyph);
|
||||
texture_index = gsk_vulkan_renderer_cache_glyph (renderer, (PangoFont *)font, gi->glyph);
|
||||
if (op.text.texture_index == G_MAXUINT)
|
||||
op.text.texture_index = texture_index;
|
||||
if (texture_index != op.text.texture_index)
|
||||
@ -1225,9 +1225,9 @@ 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,
|
||||
gsk_text_node_get_font (op->text.node),
|
||||
gsk_text_node_get_glyphs (op->text.node),
|
||||
gsk_text_node_get_color (op->text.node),
|
||||
gsk_text_node_peek_font (op->text.node),
|
||||
gsk_text_node_peek_glyphs (op->text.node),
|
||||
gsk_text_node_peek_color (op->text.node),
|
||||
gsk_text_node_get_x (op->text.node),
|
||||
gsk_text_node_get_y (op->text.node),
|
||||
op->text.start_glyph,
|
||||
@ -1243,8 +1243,8 @@ 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,
|
||||
gsk_text_node_get_font (op->text.node),
|
||||
gsk_text_node_get_glyphs (op->text.node),
|
||||
gsk_text_node_peek_font (op->text.node),
|
||||
gsk_text_node_peek_glyphs (op->text.node),
|
||||
gsk_text_node_get_x (op->text.node),
|
||||
gsk_text_node_get_y (op->text.node),
|
||||
op->text.start_glyph,
|
||||
|
@ -378,16 +378,16 @@ populate_render_node_properties (GtkListStore *store,
|
||||
|
||||
case GSK_TEXT_NODE:
|
||||
{
|
||||
PangoFont *font = gsk_text_node_get_font (node);
|
||||
PangoGlyphString *glyphs = gsk_text_node_get_glyphs (node);
|
||||
const GdkRGBA *color = gsk_text_node_get_color (node);
|
||||
const PangoFont *font = gsk_text_node_peek_font (node);
|
||||
const PangoGlyphString *glyphs = gsk_text_node_peek_glyphs (node);
|
||||
const GdkRGBA *color = gsk_text_node_peek_color (node);
|
||||
float x = gsk_text_node_get_x (node);
|
||||
float y = gsk_text_node_get_y (node);
|
||||
PangoFontDescription *desc;
|
||||
GString *s;
|
||||
int i;
|
||||
|
||||
desc = pango_font_describe (font);
|
||||
desc = pango_font_describe ((PangoFont *)font);
|
||||
tmp = pango_font_description_to_string (desc);
|
||||
add_text_row (store, "Font", tmp);
|
||||
g_free (tmp);
|
||||
|
Loading…
Reference in New Issue
Block a user