Bug 460023. Change the glyph dropping safety margin from 2em to 10em. r=vlad

This commit is contained in:
Behdad Esfahod 2009-01-28 22:36:23 +13:00
Родитель 70a066fe65
Коммит a50998e4f0
3 изменённых файлов: 50 добавлений и 5 удалений

Просмотреть файл

@ -40,6 +40,8 @@ ft-done-face.patch: bug 467874; only destroy FT_Faces created by cairo
wince-fontconfig.patch: bug 462908; fixes required to compile for windows ce. Also allows for building without fontconfig
gfx/cairo/glyph-safety-margin.patch: Change the glyph dropping safety margin from 2em to 10em for bug 460023. Upstream commit: 28a72648ba7abe02ebd4df7234424e333b85dc9c.
==== pixman patches ====
endian.patch: include cairo-platform.h for endian macros

Просмотреть файл

@ -1729,7 +1729,6 @@ _cairo_gstate_transform_glyphs_to_backend (cairo_gstate_t *gstate,
if (num_transformed_glyphs != NULL) {
cairo_rectangle_int_t surface_extents;
double scale = _cairo_scaled_font_get_max_scale (gstate->scaled_font);
drop = TRUE;
status = _cairo_gstate_int_clip_extents (gstate, &surface_extents);
@ -1739,6 +1738,7 @@ _cairo_gstate_transform_glyphs_to_backend (cairo_gstate_t *gstate,
if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
drop = FALSE; /* unbounded surface */
} else {
double scale10 = 10 * _cairo_scaled_font_get_max_scale (gstate->scaled_font);
if (surface_extents.width == 0 || surface_extents.height == 0) {
/* No visible area. Don't draw anything */
*num_transformed_glyphs = 0;
@ -1752,10 +1752,10 @@ _cairo_gstate_transform_glyphs_to_backend (cairo_gstate_t *gstate,
* to device if it's going to be visible, but I'm not inclined to
* do that now.
*/
x1 = surface_extents.x - 2*scale;
y1 = surface_extents.y - 2*scale;
x2 = surface_extents.x + surface_extents.width + scale;
y2 = surface_extents.y + surface_extents.height + scale;
x1 = surface_extents.x - scale10;
y1 = surface_extents.y - scale10;
x2 = surface_extents.x + (int) surface_extents.width + scale10;
y2 = surface_extents.y + (int) surface_extents.height + scale10;
}
if (!drop)

Просмотреть файл

@ -0,0 +1,43 @@
From 28a72648ba7abe02ebd4df7234424e333b85dc9c Mon Sep 17 00:00:00 2001
From: Behdad Esfahbod<behdad@behdad.org>
Date: Tue, 30 Dec 2008 18:48:47 +0000
Subject: [gstate] Change the glyph dropping safety margin from 2em to 10em
The small margin caused bugs with math fonts. See:
https://bugzilla.mozilla.org/show_bug.cgi?id=460023
---
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index df7ec5c..c79e799 100644
--- a/gfx/cairo/cairo/src/cairo-gstate.c
+++ b/gfx/cairo/cairo/src/cairo-gstate.c
@@ -1804,7 +1804,6 @@ _cairo_gstate_transform_glyphs_to_backend (cairo_gstate_t *gstate,
if (num_transformed_glyphs != NULL) {
cairo_rectangle_int_t surface_extents;
- double scale = _cairo_scaled_font_get_max_scale (gstate->scaled_font);
drop = TRUE;
status = _cairo_gstate_int_clip_extents (gstate, &surface_extents);
@@ -1814,6 +1813,7 @@ _cairo_gstate_transform_glyphs_to_backend (cairo_gstate_t *gstate,
if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
drop = FALSE; /* unbounded surface */
} else {
+ double scale10 = 10 * _cairo_scaled_font_get_max_scale (gstate->scaled_font);
if (surface_extents.width == 0 || surface_extents.height == 0) {
/* No visible area. Don't draw anything */
*num_transformed_glyphs = 0;
@@ -1827,10 +1827,10 @@ _cairo_gstate_transform_glyphs_to_backend (cairo_gstate_t *gstate,
* to device if it's going to be visible, but I'm not inclined to
* do that now.
*/
- x1 = surface_extents.x - 2*scale;
- y1 = surface_extents.y - 2*scale;
- x2 = surface_extents.x + surface_extents.width + scale;
- y2 = surface_extents.y + surface_extents.height + scale;
+ x1 = surface_extents.x - scale10;
+ y1 = surface_extents.y - scale10;
+ x2 = surface_extents.x + (int) surface_extents.width + scale10;
+ y2 = surface_extents.y + (int) surface_extents.height + scale10;
}
if (!drop)