Author: Carlos Lopez <genet...@gmail.com> Date: Thu Sep 6 17:27:14 2012 +0200
Layer_Freetype: small optimization --- .../src/modules/lyr_freetype/lyr_freetype.cpp | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/synfig-core/src/modules/lyr_freetype/lyr_freetype.cpp b/synfig-core/src/modules/lyr_freetype/lyr_freetype.cpp index 4fa1185..ff18718 100644 --- a/synfig-core/src/modules/lyr_freetype/lyr_freetype.cpp +++ b/synfig-core/src/modules/lyr_freetype/lyr_freetype.cpp @@ -1044,9 +1044,9 @@ Layer_Freetype::accelerated_cairorender(Context context,cairo_surface_t *surface cairo_fill(subcr); cairo_restore(subcr); } - - // Render the text on the target surface with the proper operator cairo_restore(subcr); + + // Render the text on the target surface with the proper operator if(invert) { cairo_set_source_surface(invertcr, subimage, 0,0); @@ -1059,8 +1059,16 @@ Layer_Freetype::accelerated_cairorender(Context context,cairo_surface_t *surface cairo_set_source_surface(cr, inverted, 0, 0); else cairo_set_source_surface(cr, subimage, 0, 0); - cairo_set_operator(cr, CAIRO_OPERATOR_OVER); // TODO: this has to be the real operator - cairo_paint_with_alpha(cr, get_amount()); + if(is_solid_color()) + { + cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); + cairo_paint(cr); + } + else + { + cairo_set_operator(cr, CAIRO_OPERATOR_OVER); // TODO: this has to be the real operator + cairo_paint_with_alpha(cr, get_amount()); + } cairo_restore(cr); // Destroy and return ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Synfig-devl mailing list Synfig-devl@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/synfig-devl