mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 05:16:05 +00:00
pango: 3rd time's the charm. Fix attribute list handling.
Really really fix attribute list handling by taking a copy of the original attributes that pango_attr_list_filter can mutate, but keep the original around intact to restore later.
This commit is contained in:
parent
bc42d382e2
commit
fb102419c7
1 changed files with 8 additions and 3 deletions
|
@ -1339,13 +1339,18 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay,
|
|||
|
||||
/* draw shadow text */
|
||||
{
|
||||
PangoAttrList *origin_attr, *filtered_attr;
|
||||
PangoAttrList *origin_attr, *filtered_attr, *temp_attr;
|
||||
|
||||
/* Store a ref on the original attributes for later restoration */
|
||||
origin_attr =
|
||||
pango_attr_list_copy (pango_layout_get_attributes (overlay->layout));
|
||||
pango_attr_list_ref (pango_layout_get_attributes (overlay->layout));
|
||||
/* Take a copy of the original attributes, because pango_attr_list_filter
|
||||
* modifies the passed list */
|
||||
temp_attr = pango_attr_list_copy (origin_attr);
|
||||
filtered_attr =
|
||||
pango_attr_list_filter (origin_attr,
|
||||
pango_attr_list_filter (temp_attr,
|
||||
gst_text_overlay_filter_foreground_attr, NULL);
|
||||
pango_attr_list_unref (temp_attr);
|
||||
|
||||
cairo_save (cr);
|
||||
cairo_translate (cr, overlay->shadow_offset, overlay->shadow_offset);
|
||||
|
|
Loading…
Reference in a new issue