diff --git a/ChangeLog b/ChangeLog index 51d05a2f7..b1b6ba895 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2015-01-14 Behdad Esfahbod + + [base] Do not reorder library->renderers upon use. + + Instead of keeping `library->renderers' in a MRU order, just leave + it as-is. The MRU machinery wasn't thread-safe. + + With this patch, rasterizing glyphs from different faces from + different threads doesn't fail choosing rasterizer + (FT_Err_Cannot_Render_Glyph). + + Easiest to see that crash was to add a `printf' (or otherwise let + thread yield in FT_Throw with debugging enabled). + + * src/base/ftobjs.c (FT_Render_Glyph_Internal), src/base/ftoutln.c + (FT_Outline_Render): Don't call `FT_Set_Renderer'. + 2015-01-14 Behdad Esfahbod [raster] Allocate render pool for mono rasterizer on the stack. diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index ee15a016c..6d685b5aa 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -4084,8 +4084,7 @@ default: { - FT_ListNode node = 0; - FT_Bool update = 0; + FT_ListNode node = 0; /* small shortcut for the very common case */ @@ -4112,16 +4111,6 @@ /* now, look for another renderer that supports the same */ /* format. */ renderer = FT_Lookup_Renderer( library, slot->format, &node ); - update = 1; - } - - /* if we changed the current renderer for the glyph image format */ - /* we need to select it as the next current one */ - if ( !error && update && renderer ) - { - error = FT_Set_Renderer( library, renderer, 0, 0 ); - if ( error ) - break; } } } diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c index 8749d64ce..45f074c52 100644 --- a/src/base/ftoutln.c +++ b/src/base/ftoutln.c @@ -612,7 +612,6 @@ FT_Raster_Params* params ) { FT_Error error; - FT_Bool update = FALSE; FT_Renderer renderer; FT_ListNode node; @@ -646,14 +645,8 @@ /* format */ renderer = FT_Lookup_Renderer( library, FT_GLYPH_FORMAT_OUTLINE, &node ); - update = TRUE; } - /* if we changed the current renderer for the glyph image format */ - /* we need to select it as the next current one */ - if ( !error && update && renderer ) - error = FT_Set_Renderer( library, renderer, 0, 0 ); - return error; }