From: <hba...@us...> - 2009-06-17 03:58:55
|
Revision: 10054 http://plplot.svn.sourceforge.net/plplot/?rev=10054&view=rev Author: hbabcock Date: 2009-06-17 03:58:54 +0000 (Wed, 17 Jun 2009) Log Message: ----------- Accidently also checked in Hez's arc additions to the cairo driver. This commit hopefully removes these additions. Modified Paths: -------------- trunk/drivers/cairo.c Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2009-06-17 03:54:28 UTC (rev 10053) +++ trunk/drivers/cairo.c 2009-06-17 03:58:54 UTC (rev 10054) @@ -215,7 +215,6 @@ static void set_current_context(PLStream *); static void poly_line(PLStream *, short *, short *, PLINT); static void filled_polygon(PLStream *pls, short *xa, short *ya, PLINT npts); -static void arc(PLStream *, arc_struct *); static void rotate_cairo_surface(PLStream *, float, float, float, float, float, float); /* Rasterization of plotted material */ static void start_raster(PLStream*); @@ -487,9 +486,6 @@ case PLESC_END_RASTERIZE: /* End offscreen/rasterized rendering */ end_raster(pls); break; - case PLESC_ARC: /* Draw an arc, either filled or outline */ - arc(pls, (arc_struct *) ptr); - break; } } @@ -996,7 +992,6 @@ pls->alt_unicode = 1; /* Wants to handle unicode character by character */ pls->page = 0; pls->dev_fill0 = 1; /* Supports hardware solid fills */ - pls->dev_arc = 1; /* Supports driver-level arcs */ pls->plbuf_write = 1; /* Activate plot buffer */ @@ -1154,60 +1149,6 @@ } /*--------------------------------------------------------------------- - arc() - - Draws an arc, possibly filled. - ---------------------------------------------------------------------*/ - -void arc(PLStream *pls, arc_struct *arc_info) -{ - /* - TODO: - - Decide on a direction for increasing angles and make sure this Cairo - implementation matches the software/fallback implementation. - - Add clipping to viewport boundaries - */ - PLCairo *aStream; - double x, y, a, b; - double angle1, angle2; - double rotation; - - set_current_context(pls); - - aStream = (PLCairo *)pls->dev; - - /* Scale to the proper Cairo coordinates */ - x = aStream->downscale * arc_info->x; - y = aStream->downscale * arc_info->y; - a = aStream->downscale * arc_info->a; - b = aStream->downscale * arc_info->b; - - /* Degrees to radians */ - angle1 = arc_info->angle1 * M_PI / 180.0; - angle2 = arc_info->angle2 * M_PI / 180.0; - rotation = - arc_info->rotation * M_PI / 180.0; - - /* Make sure the arc is properly shaped */ - cairo_save(aStream->cairoContext); - cairo_translate(aStream->cairoContext, x, y); - cairo_rotate(aStream->cairoContext, rotation); - cairo_scale(aStream->cairoContext, a, b); - cairo_arc(aStream->cairoContext, 0.0, 0.0, 1.0, angle1, angle2); - cairo_restore(aStream->cairoContext); - cairo_set_source_rgba(aStream->cairoContext, - (double)pls->curcolor.r/255.0, - (double)pls->curcolor.g/255.0, - (double)pls->curcolor.b/255.0, - (double)pls->curcolor.a); - if (arc_info->fill) { - cairo_fill(aStream->cairoContext); - } - else { - cairo_stroke(aStream->cairoContext); - } -} - -/*--------------------------------------------------------------------- rotate_cairo_surface() Rotates the cairo surface to the appropriate orientation. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |