[gtk+] gsk: Tweak text node apis
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gsk: Tweak text node apis
- Date: Fri, 20 Oct 2017 12:44:30 +0000 (UTC)
commit 04f6b262051a1c8ea6afdc7b88412184bf6f32b8
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Oct 20 09:12:19 2017 +0200
gsk: Tweak text node apis
Rename getters to follow the peek naming pattern.
Update all callers.
gsk/gskrendernode.h | 8 ++++----
gsk/gskrendernodeimpl.c | 10 +++++-----
gsk/gskvulkanrenderpass.c | 18 +++++++++---------
gtk/inspector/recorder.c | 8 ++++----
4 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/gsk/gskrendernode.h b/gsk/gskrendernode.h
index bc81268..cec3728 100644
--- a/gsk/gskrendernode.h
+++ b/gsk/gskrendernode.h
@@ -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
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index 1072dfc..e35c1cd 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -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;
diff --git a/gsk/gskvulkanrenderpass.c b/gsk/gskvulkanrenderpass.c
index 83d9e2e..40d2717 100644
--- a/gsk/gskvulkanrenderpass.c
+++ b/gsk/gskvulkanrenderpass.c
@@ -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,
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
index 1aeee3b..ff59dd7 100644
--- a/gtk/inspector/recorder.c
+++ b/gtk/inspector/recorder.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]