diff options
author | Christian Hergert <chergert@redhat.com> | 2023-03-11 11:19:11 +0100 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2023-03-11 11:19:11 +0100 |
commit | 0dc3dbae6cf71ee3f0efb1f31b8fd3eda7c150dd (patch) | |
tree | 8aff0bd5bccff0bb7a7af08e2fba711e2481e656 | |
parent | 293cd2f7d61ba869c64cf069db72b85ca4395937 (diff) | |
download | vte-0dc3dbae6cf71ee3f0efb1f31b8fd3eda7c150dd.tar.gz |
fonts: keep layout text available for cairo
When a cairo recording surface is used, it will memcpy() the text and
therefore expects the layout's text to be complete enough to contain each
glyph item's offset from base pointer.
This keeps that text around long enough to satisfy that requirement. It
will be reset on the next operation/call to get_unistr_info().
Fixes #2620
(cherry picked from commit 22b3a562d5c95f5911560131c9f6f2df70881e34)
Fixes: https://gitlab.gnome.org/Teams/Releng/freeze-breaks/-/issues/131
-rw-r--r-- | src/fonts-pangocairo.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/fonts-pangocairo.cc b/src/fonts-pangocairo.cc index 6a136dd0..476526b9 100644 --- a/src/fonts-pangocairo.cc +++ b/src/fonts-pangocairo.cc @@ -475,11 +475,6 @@ FontInfo::get_unistr_info(vteunistr c) uinfo->set_coverage(UnistrInfo::Coverage::USE_PANGO_LAYOUT_LINE); ufi->using_pango_layout_line.line = pango_layout_line_ref (line); - /* we hold a manual reference on layout. pango currently - * doesn't work if line->layout is NULL. ugh! */ - pango_layout_set_text(m_layout.get(), "", -1); /* make layout disassociate from the line */ - ufi->using_pango_layout_line.line->layout = (PangoLayout *)g_object_ref(m_layout.get()); - } else { PangoGlyphItem *glyph_item = (PangoGlyphItem *)line->runs->data; PangoFont *pango_font = glyph_item->item->analysis.font; @@ -509,10 +504,10 @@ FontInfo::get_unistr_info(vteunistr c) ufi->using_pango_glyph_string.font = pango_font ? (PangoFont *)g_object_ref (pango_font) : NULL; ufi->using_pango_glyph_string.glyph_string = pango_glyph_string_copy (glyph_string); } - } - /* release internal layout resources */ - pango_layout_set_text(m_layout.get(), "", -1); + /* release internal layout resources */ + pango_layout_set_text(m_layout.get(), "", -1); + } #ifdef VTE_DEBUG m_coverage_count[0]++; |