From: <ai...@us...> - 2011-03-02 20:47:18
|
Revision: 11588 http://plplot.svn.sourceforge.net/plplot/?rev=11588&view=rev Author: airwin Date: 2011-03-02 20:47:12 +0000 (Wed, 02 Mar 2011) Log Message: ----------- Make cairo devices honor the -eofill option. Implemented and tested (using example 27) for xcairo, pdfcairo, pscairo, svgcairo, and raster devices (e.g., pngcairo and jpgcairo). Implemented for memcairo, extcairo, and wincairo. N.B. those latter devices need testing with fills for self-intersecting boundaries. Modified Paths: -------------- trunk/drivers/cairo.c Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2011-03-02 18:58:17 UTC (rev 11587) +++ trunk/drivers/cairo.c 2011-03-02 20:47:12 UTC (rev 11588) @@ -1615,6 +1615,12 @@ // Set graphics aliasing cairo_set_antialias( aStream->cairoContext, aStream->graphics_anti_aliasing ); + // Set fill rule for the case of self-intersecting boundaries. + if ( pls->dev_eofill) + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_EVEN_ODD); + else + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_WINDING); + // Fill in the X window with the background color to avoid starting out // with a blank window of an unexpected color. cairo_rectangle( aStream->cairoContext_X, 0.0, 0.0, pls->xlength, pls->ylength ); @@ -2038,6 +2044,13 @@ // Set graphics aliasing cairo_set_antialias( aStream->cairoContext, aStream->graphics_anti_aliasing ); + + // Set fill rule for the case of self-intersecting boundaries. + if ( pls->dev_eofill) + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_EVEN_ODD); + else + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_WINDING); + } #endif @@ -2112,9 +2125,15 @@ pls->freeaspect = 1; } rotate_cairo_surface( pls, 0.0, -1.0, -1.0, 0.0, pls->ylength, pls->xlength, FALSE ); + + // Set fill rule for the case of self-intersecting boundaries. + if ( pls->dev_eofill) + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_EVEN_ODD); + else + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_WINDING); + } - #endif @@ -2206,6 +2225,13 @@ // Set graphics aliasing cairo_set_antialias( aStream->cairoContext, aStream->graphics_anti_aliasing ); + + // Set fill rule for the case of self-intersecting boundaries. + if ( pls->dev_eofill) + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_EVEN_ODD); + else + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_WINDING); + } #endif @@ -2300,6 +2326,13 @@ // Set graphics aliasing cairo_set_antialias( aStream->cairoContext, aStream->graphics_anti_aliasing ); + + // Set fill rule for the case of self-intersecting boundaries. + if ( pls->dev_eofill) + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_EVEN_ODD); + else + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_WINDING); + } //-------------------------------------------------------------------------- @@ -2488,6 +2521,13 @@ // Set graphics aliasing cairo_set_antialias( aStream->cairoContext, aStream->graphics_anti_aliasing ); + + // Set fill rule for the case of self-intersecting boundaries. + if ( pls->dev_eofill) + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_EVEN_ODD); + else + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_WINDING); + } //-------------------------------------------------------------------------- @@ -2702,6 +2742,12 @@ { extcairo_setbackground( pls ); } + + // Set fill rule for the case of self-intersecting boundaries. + if ( pls->dev_eofill) + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_EVEN_ODD); + else + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_WINDING); break; default: // Fall back on default Cairo actions plD_esc_cairo( pls, op, ptr ); @@ -3044,6 +3090,13 @@ // Set graphics aliasing cairo_set_antialias( aStream->cairoContext, aStream->graphics_anti_aliasing ); + + // Set fill rule for the case of self-intersecting boundaries. + if ( pls->dev_eofill) + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_EVEN_ODD); + else + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_WINDING); + } //-------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |