~ubuntu-branches/ubuntu/raring/cairo/raring

« back to all changes in this revision

Viewing changes to src/cairo-stroke-style.c

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-01-23 21:19:34 UTC
  • mfrom: (1.3.11) (28.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130123211934-q9qb538ujcmkliic
Tags: 1.12.10-1ubuntu1
* Merge from Debian, remaining changes:
* debian/patches/server_side_gradients.patch:
  - Don't use server side gradients, most drivers don't handle those and
    are really slow
* debian/control: Add missing libxext-dev dependency to libcairo2-dev.
  Spotted by autopkgtest.
* debian/patches/git_evince_rendering_fix.patch:
  Backport GIT commit to fix a rendering bug in evince
* debian/control, debian/libcairo2.symbols, debian/rules:
  - Disable GL backend due to LP: #725434

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
    }
128
128
}
129
129
 
 
130
void
 
131
_cairo_stroke_style_max_line_distance_from_path (const cairo_stroke_style_t *style,
 
132
                                                 const cairo_path_fixed_t *path,
 
133
                                                 const cairo_matrix_t *ctm,
 
134
                                                 double *dx, double *dy)
 
135
{
 
136
    double style_expansion = 0.5 * style->line_width;
 
137
    if (_cairo_matrix_has_unity_scale (ctm)) {
 
138
        *dx = *dy = style_expansion;
 
139
    } else {
 
140
        *dx = style_expansion * hypot (ctm->xx, ctm->xy);
 
141
        *dy = style_expansion * hypot (ctm->yy, ctm->yx);
 
142
    }
 
143
}
 
144
 
 
145
void
 
146
_cairo_stroke_style_max_join_distance_from_path (const cairo_stroke_style_t *style,
 
147
                                                 const cairo_path_fixed_t *path,
 
148
                                                 const cairo_matrix_t *ctm,
 
149
                                                 double *dx, double *dy)
 
150
{
 
151
    double style_expansion = 0.5;
 
152
 
 
153
    if (style->line_join == CAIRO_LINE_JOIN_MITER &&
 
154
        ! path->stroke_is_rectilinear &&
 
155
        style_expansion < M_SQRT2 * style->miter_limit)
 
156
    {
 
157
        style_expansion = M_SQRT2 * style->miter_limit;
 
158
    }
 
159
 
 
160
    style_expansion *= style->line_width;
 
161
 
 
162
    if (_cairo_matrix_has_unity_scale (ctm)) {
 
163
        *dx = *dy = style_expansion;
 
164
    } else {
 
165
        *dx = style_expansion * hypot (ctm->xx, ctm->xy);
 
166
        *dy = style_expansion * hypot (ctm->yy, ctm->yx);
 
167
    }
 
168
}
130
169
/*
131
170
 * Computes the period of a dashed stroke style.
132
171
 * Returns 0 for non-dashed styles.