diff options
author | Olivier Bailly <olivier@google.com> | 2011-11-07 15:47:04 -0800 |
---|---|---|
committer | Geremy Condra <gcondra@google.com> | 2011-11-11 10:43:54 -0800 |
commit | bff90fb5ec88ad7fdfb6d1d2f5a5719c20a2c5dc (patch) | |
tree | 720489aa1d9176e568acf0f8cb441a3f8cb0663f /src/smooth | |
parent | 50571ad2593c5b9c46fc93ea59bfd82a80c1b55c (diff) | |
download | android_external_freetype-bff90fb5ec88ad7fdfb6d1d2f5a5719c20a2c5dc.tar.gz android_external_freetype-bff90fb5ec88ad7fdfb6d1d2f5a5719c20a2c5dc.tar.bz2 android_external_freetype-bff90fb5ec88ad7fdfb6d1d2f5a5719c20a2c5dc.zip |
DO NOT MERGE Update FreeType library to 2.4.7
Copied common files from upstream repository only.
changes to ftoption.h which were intentionally NOT taken:
/* contain no glyph data, but supply it via a callback function. */
/* This is required by clients supporting document formats which */
/* supply font data incrementally as the document is parsed, such */
/* as the Ghostscript interpreter for the PostScript language. */
/* */
-/* #define FT_CONFIG_OPTION_INCREMENTAL */
+#define FT_CONFIG_OPTION_INCREMENTAL
/*************************************************************************/
/* */
/* The size in bytes of the render pool used by the scan-line converter */
@@ -553,11 +553,11 @@ FT_BEGIN_HEADER
/* TrueType glyphs without hinting. */
/* */
/* Do not #undef this macro here, since the build system might */
/* define it for certain configurations only. */
/* */
-/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
+#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
/*************************************************************************/
/* */
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
@@ -603,11 +603,11 @@ FT_BEGIN_HEADER
/* */
/* error = FT_Open_Face( library, &open_args, index, &face ); */
/* ... */
/* } */
/* */
-#define TT_CONFIG_OPTION_UNPATENTED_HINTING
+/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
Manual changes to ftmodule.h:
+/*
+ * New modules in 2.4.7:
+FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
+FT_USE_MODULE( FT_Module_Class, psaux_module_class )
+FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
+ */
+
These lines were added for 2.4.7 but we decided to stick with our current use.
Change-Id: Ic1b52909580c78ead44cf4f882be06f2837539db
Diffstat (limited to 'src/smooth')
-rw-r--r-- | src/smooth/ftgrays.c | 89 |
1 files changed, 44 insertions, 45 deletions
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c index 40de269..895e748 100644 --- a/src/smooth/ftgrays.c +++ b/src/smooth/ftgrays.c @@ -872,6 +872,7 @@ typedef ptrdiff_t FT_PtrDist; const FT_Vector* to ) { TPos dx, dy; + TPos min, max, y; int top, level; int* levels; FT_Vector* arc; @@ -884,45 +885,45 @@ typedef ptrdiff_t FT_PtrDist; arc[1].y = UPSCALE( control->y ); arc[2].x = ras.x; arc[2].y = ras.y; + top = 0; dx = FT_ABS( arc[2].x + arc[0].x - 2 * arc[1].x ); dy = FT_ABS( arc[2].y + arc[0].y - 2 * arc[1].y ); if ( dx < dy ) dx = dy; + if ( dx < ONE_PIXEL / 4 ) + goto Draw; + + /* short-cut the arc that crosses the current band */ + min = max = arc[0].y; + + y = arc[1].y; + if ( y < min ) min = y; + if ( y > max ) max = y; + + y = arc[2].y; + if ( y < min ) min = y; + if ( y > max ) max = y; + + if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey ) + goto Draw; + level = 0; - while ( dx > ONE_PIXEL / 6 ) + do { dx >>= 2; level++; - } + } while ( dx > ONE_PIXEL / 4 ); levels = ras.lev_stack; levels[0] = level; - top = 0; do { level = levels[top]; - if ( level > 1 ) + if ( level > 0 ) { - /* check that the arc crosses the current band */ - TPos min, max, y; - - - min = max = arc[0].y; - - y = arc[1].y; - if ( y < min ) min = y; - if ( y > max ) max = y; - - y = arc[2].y; - if ( y < min ) min = y; - if ( y > max ) max = y; - - if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey ) - goto Draw; - gray_split_conic( arc ); arc += 2; top++; @@ -973,6 +974,7 @@ typedef ptrdiff_t FT_PtrDist; const FT_Vector* to ) { FT_Vector* arc; + TPos min, max, y; arc = ras.bez_stack; @@ -985,35 +987,32 @@ typedef ptrdiff_t FT_PtrDist; arc[3].x = ras.x; arc[3].y = ras.y; - for (;;) - { - /* Check that the arc crosses the current band. */ - TPos min, max, y; - - - min = max = arc[0].y; + /* Short-cut the arc that crosses the current band. */ + min = max = arc[0].y; - y = arc[1].y; - if ( y < min ) - min = y; - if ( y > max ) - max = y; + y = arc[1].y; + if ( y < min ) + min = y; + if ( y > max ) + max = y; - y = arc[2].y; - if ( y < min ) - min = y; - if ( y > max ) - max = y; + y = arc[2].y; + if ( y < min ) + min = y; + if ( y > max ) + max = y; - y = arc[3].y; - if ( y < min ) - min = y; - if ( y > max ) - max = y; + y = arc[3].y; + if ( y < min ) + min = y; + if ( y > max ) + max = y; - if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey ) - goto Draw; + if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey ) + goto Draw; + for (;;) + { /* Decide whether to split or draw. See `Rapid Termination */ /* Evaluation for Recursive Subdivision of Bezier Curves' by Thomas */ /* F. Hain, at */ |