diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-12-04 23:47:27 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-12-04 23:47:27 +0000 |
commit | aab9ad8715dbbf3a23d4fc869a6551af1f56df57 (patch) | |
tree | 6b19cc04fb3384de8afeda5a3e2ad11c7a8aed88 /pango/pango-renderer.c | |
parent | ea0ec593e49735b1c7157c73d24ac58423adafc0 (diff) | |
download | pango-aab9ad8715dbbf3a23d4fc869a6551af1f56df57.tar.gz |
Bug 135683 – Cache glyphstring extents
2006-12-04 Behdad Esfahbod <behdad@gnome.org>
Bug 135683 – Cache glyphstring extents
* pango/pango-layout.c (pango_layout_get_lines),
(pango_layout_get_line), (pango_layout_line_leaked),
(pango_layout_line_get_extents), (pango_layout_line_new),
(pango_layout_iter_get_run), (pango_layout_iter_get_line):
Cache line extents. Line extents are cached only if the user doesn't
have a pointer to the line or any of its runs. Functions that give
away such pointers mark the line as "leak"ed.
* pango/pango-layout.c (pango_layout_index_to_line_and_extents),
(pango_layout_xy_to_index), (pango_layout_index_to_pos):
Use _pango_layout_iter_get_line() which is like
pango_layout_iter_get_line() but doesn't leak the line.
* pango/pango-layout-private.h: Add pango_layout_iter_get_line()
duplicate _pango_layout_iter_get_line_readonly() that doesn't leak
the line.
* pango/pango-renderer.c (pango_renderer_draw_layout): Use
_pango_layout_iter_get_line_readonly().
Diffstat (limited to 'pango/pango-renderer.c')
-rw-r--r-- | pango/pango-renderer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c index 9a37bed9..4169c3b5 100644 --- a/pango/pango-renderer.c +++ b/pango/pango-renderer.c @@ -23,6 +23,7 @@ #include <stdlib.h> #include "pango-renderer.h" +#include "pango-layout-private.h" #define N_RENDER_PARTS 4 @@ -176,7 +177,7 @@ pango_renderer_draw_layout (PangoRenderer *renderer, PangoLayoutLine *line; int baseline; - line = pango_layout_iter_get_line (iter); + line = _pango_layout_iter_get_line_readonly (iter); pango_layout_iter_get_line_extents (iter, NULL, &logical_rect); baseline = pango_layout_iter_get_baseline (iter); |