diff options
author | Anas Nashif <anas.nashif@intel.com> | 2013-02-11 07:02:05 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2013-02-11 07:02:05 -0800 |
commit | b90199182adaba2f31d156ee5582bfe42d58fc15 (patch) | |
tree | d99d1e3ed498f0e9e0821d16c22c44d5479f6fb1 /src/cairo-path-stroke.c | |
parent | a38f0dced529c3f584fd69c10373893842f4d1d5 (diff) | |
download | cairo-b90199182adaba2f31d156ee5582bfe42d58fc15.tar.gz cairo-b90199182adaba2f31d156ee5582bfe42d58fc15.tar.bz2 cairo-b90199182adaba2f31d156ee5582bfe42d58fc15.zip |
Imported Upstream version 1.12.14upstream/1.12.14
Diffstat (limited to 'src/cairo-path-stroke.c')
-rw-r--r-- | src/cairo-path-stroke.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c index 66ab3bd..cd6b3a2 100644 --- a/src/cairo-path-stroke.c +++ b/src/cairo-path-stroke.c @@ -52,6 +52,7 @@ typedef struct cairo_stroker { const cairo_matrix_t *ctm; const cairo_matrix_t *ctm_inverse; + double half_line_width; double tolerance; double ctm_determinant; cairo_bool_t ctm_det_positive; @@ -134,13 +135,13 @@ _cairo_stroker_init (cairo_stroker_t *stroker, stroker->ctm = ctm; stroker->ctm_inverse = ctm_inverse; stroker->tolerance = tolerance; + stroker->half_line_width = stroke_style->line_width / 2.0; stroker->ctm_determinant = _cairo_matrix_compute_determinant (stroker->ctm); stroker->ctm_det_positive = stroker->ctm_determinant >= 0.0; status = _cairo_pen_init (&stroker->pen, - stroke_style->line_width / 2.0, - tolerance, ctm); + stroker->half_line_width, tolerance, ctm); if (unlikely (status)) return status; @@ -637,8 +638,8 @@ _cairo_stroker_add_cap (cairo_stroker_t *stroker, dx = f->usr_vector.x; dy = f->usr_vector.y; - dx *= stroker->style.line_width / 2.0; - dy *= stroker->style.line_width / 2.0; + dx *= stroker->half_line_width; + dy *= stroker->half_line_width; cairo_matrix_transform_distance (stroker->ctm, &dx, &dy); fvector.dx = _cairo_fixed_from_double (dx); fvector.dy = _cairo_fixed_from_double (dy); @@ -776,13 +777,13 @@ _compute_face (const cairo_point_t *point, cairo_slope_t *dev_slope, */ if (stroker->ctm_det_positive) { - face_dx = - slope_dy * (stroker->style.line_width / 2.0); - face_dy = slope_dx * (stroker->style.line_width / 2.0); + face_dx = - slope_dy * stroker->half_line_width; + face_dy = slope_dx * stroker->half_line_width; } else { - face_dx = slope_dy * (stroker->style.line_width / 2.0); - face_dy = - slope_dx * (stroker->style.line_width / 2.0); + face_dx = slope_dy * stroker->half_line_width; + face_dy = - slope_dx * stroker->half_line_width; } /* back to device space */ @@ -1340,12 +1341,12 @@ BAIL: } cairo_int_status_t -_cairo_path_fixed_stroke_to_traps (const cairo_path_fixed_t *path, - const cairo_stroke_style_t *stroke_style, - const cairo_matrix_t *ctm, - const cairo_matrix_t *ctm_inverse, - double tolerance, - cairo_traps_t *traps) +_cairo_path_fixed_stroke_polygon_to_traps (const cairo_path_fixed_t *path, + const cairo_stroke_style_t *stroke_style, + const cairo_matrix_t *ctm, + const cairo_matrix_t *ctm_inverse, + double tolerance, + cairo_traps_t *traps) { cairo_int_status_t status; cairo_polygon_t polygon; |