diff options
-rw-r--r-- | gfx/cairo/cairo/src/cairo-rename.h | 1 | ||||
-rw-r--r-- | gfx/cairo/cairo/src/cairo-scaled-font.c | 20 | ||||
-rw-r--r-- | gfx/cairo/cairo/src/cairo.h | 3 | ||||
-rw-r--r-- | gfx/cairo/cairo/src/cairoint.h | 1 | ||||
-rw-r--r-- | gfx/thebes/gfxFont.cpp | 5 | ||||
-rw-r--r-- | layout/media/symbols.def.in | 1 |
6 files changed, 27 insertions, 4 deletions
diff --git a/gfx/cairo/cairo/src/cairo-rename.h b/gfx/cairo/cairo/src/cairo-rename.h index db20352ea6..0228596c3d 100644 --- a/gfx/cairo/cairo/src/cairo-rename.h +++ b/gfx/cairo/cairo/src/cairo-rename.h @@ -267,6 +267,7 @@ #define cairo_scaled_font_get_font_face _moz_cairo_scaled_font_get_font_face #define cairo_scaled_font_get_font_matrix _moz_cairo_scaled_font_get_font_matrix #define cairo_scaled_font_get_font_options _moz_cairo_scaled_font_get_font_options +#define cairo_scaled_font_get_hint_metrics _moz_cairo_scaled_font_get_hint_metrics #define cairo_scaled_font_get_reference_count _moz_cairo_scaled_font_get_reference_count #define cairo_scaled_font_get_scale_matrix _moz_cairo_scaled_font_get_scale_matrix #define cairo_scaled_font_get_type _moz_cairo_scaled_font_get_type diff --git a/gfx/cairo/cairo/src/cairo-scaled-font.c b/gfx/cairo/cairo/src/cairo-scaled-font.c index 37806bc63c..1bffdce203 100644 --- a/gfx/cairo/cairo/src/cairo-scaled-font.c +++ b/gfx/cairo/cairo/src/cairo-scaled-font.c @@ -2952,3 +2952,23 @@ cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font, _cairo_font_options_init_copy (options, &scaled_font->options); } slim_hidden_def (cairo_scaled_font_get_font_options); + +/** + * cairo_scaled_font_get_hint_metrics: + * @scaled_font: a #cairo_scaled_font_t + * + * Mozilla extension since the required malloc/free to use + * cairo_scaled_font_get_font_options() above is too slow. + **/ +cairo_public cairo_hint_metrics_t +cairo_scaled_font_get_hint_metrics (cairo_scaled_font_t *scaled_font) +{ + cairo_font_options_t options; + if (scaled_font->status) { + _cairo_font_options_init_default (&options); + } else { + _cairo_font_options_init_copy (&options, &scaled_font->options); + } + return options.hint_metrics; +} +slim_hidden_def (cairo_scaled_font_get_hint_metrics);
\ No newline at end of file diff --git a/gfx/cairo/cairo/src/cairo.h b/gfx/cairo/cairo/src/cairo.h index 3a34e80bfe..f566687f98 100644 --- a/gfx/cairo/cairo/src/cairo.h +++ b/gfx/cairo/cairo/src/cairo.h @@ -1465,6 +1465,9 @@ cairo_public void cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font, cairo_font_options_t *options); +// API extension for GRE. +cairo_public cairo_hint_metrics_t +cairo_scaled_font_get_hint_metrics (cairo_scaled_font_t *scaled_font); /* Toy fonts */ diff --git a/gfx/cairo/cairo/src/cairoint.h b/gfx/cairo/cairo/src/cairoint.h index 2f638f2d7f..f5dc0da817 100644 --- a/gfx/cairo/cairo/src/cairoint.h +++ b/gfx/cairo/cairo/src/cairoint.h @@ -2434,6 +2434,7 @@ slim_hidden_proto (cairo_scaled_font_get_ctm); slim_hidden_proto (cairo_scaled_font_get_font_face); slim_hidden_proto (cairo_scaled_font_get_font_matrix); slim_hidden_proto (cairo_scaled_font_get_font_options); +slim_hidden_proto (cairo_scaled_font_get_hint_metrics); // GRE API extension slim_hidden_proto (cairo_scaled_font_glyph_extents); slim_hidden_proto_no_warn (cairo_scaled_font_reference); slim_hidden_proto (cairo_scaled_font_status); diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index a732527598..dba322521f 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -591,11 +591,8 @@ gfxFontShaper::GetRoundOffsetsToPixels(DrawTarget* aDrawTarget, } // Sometimes hint metrics gets set for us, most notably for printing. - cairo_font_options_t *font_options = cairo_font_options_create(); - cairo_scaled_font_get_font_options(scaled_font, font_options); cairo_hint_metrics_t hint_metrics = - cairo_font_options_get_hint_metrics(font_options); - cairo_font_options_destroy(font_options); + cairo_scaled_font_get_hint_metrics(scaled_font); switch (hint_metrics) { case CAIRO_HINT_METRICS_OFF: diff --git a/layout/media/symbols.def.in b/layout/media/symbols.def.in index 6e2364f51a..94866cc2ba 100644 --- a/layout/media/symbols.def.in +++ b/layout/media/symbols.def.in @@ -487,6 +487,7 @@ _moz_cairo_scaled_font_create _moz_cairo_scaled_font_destroy _moz_cairo_scaled_font_get_font_matrix _moz_cairo_scaled_font_get_font_options +_moz_cairo_scaled_font_get_hint_metrics _moz_cairo_scaled_font_get_type _moz_cairo_scaled_font_glyph_extents _moz_cairo_scaled_font_reference |