diff options
author | Timm Bäder <mail@baedert.org> | 2017-10-07 19:03:26 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-10-27 16:29:14 -0400 |
commit | 0d14052d719274e586176280b3c98dd54fcf8764 (patch) | |
tree | 90c4b74b3c5e0624229eef4b97756a72f29b6cd2 /pango/pango-layout-private.h | |
parent | 1599288b4f5394a314bfadae5af56d9b60150562 (diff) | |
download | pango-0d14052d719274e586176280b3c98dd54fcf8764.tar.gz |
PangoLayoutIter: Allocate an array of Extents instead of a linked list
Since PangoLayout caches the amount of lines it contains in
->line_count, we can use this to pre-allocate an Extents array of the
appropriate size.
https://bugzilla.gnome.org/show_bug.cgi?id=788643
Diffstat (limited to 'pango/pango-layout-private.h')
-rw-r--r-- | pango/pango-layout-private.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/pango/pango-layout-private.h b/pango/pango-layout-private.h index 9a23d9e7..4b5327ee 100644 --- a/pango/pango-layout-private.h +++ b/pango/pango-layout-private.h @@ -82,6 +82,17 @@ struct _PangoLayout guint line_count; /* Number of lines in @lines. 0 if lines is %NULL */ }; +typedef struct _Extents Extents; +struct _Extents +{ + /* Vertical position of the line's baseline in layout coords */ + int baseline; + + /* Line extents in layout coords */ + PangoRectangle ink_rect; + PangoRectangle logical_rect; +}; + struct _PangoLayoutIter { PangoLayout *layout; @@ -96,8 +107,8 @@ struct _PangoLayoutIter int index; /* list of Extents for each line in layout coordinates */ - GSList *line_extents; - GSList *line_extents_link; + Extents *line_extents; + int line_index; /* X position of the current run */ int run_x; |