Example #1
0
static unsigned long
_cairo_gl_gradient_hash (unsigned int                  n_stops,
			 const cairo_gradient_stop_t  *stops)
{
    return _cairo_hash_bytes (n_stops,
			      stops,
			      sizeof (cairo_gradient_stop_t) * n_stops);
}
Example #2
0
unsigned long
_cairo_path_fixed_hash (const cairo_path_fixed_t *path)
{
    unsigned long hash = _CAIRO_HASH_INIT_VALUE;
    const cairo_path_buf_t *buf;
    int num_points, num_ops;

    hash = _cairo_hash_bytes (hash, &path->extents, sizeof (path->extents));

    num_ops = num_points = 0;
    cairo_path_foreach_buf_start (buf, path) {
	hash = _cairo_hash_bytes (hash, buf->op,
			          buf->num_ops * sizeof (buf->op[0]));
	hash = _cairo_hash_bytes (hash, buf->points,
			          buf->num_points * sizeof (buf->points[0]));

	num_ops    += buf->num_ops;
	num_points += buf->num_points;
    } cairo_path_foreach_buf_end (buf, path);
Example #3
0
unsigned long
_cairo_path_fixed_hash (const cairo_path_fixed_t *path)
{
    unsigned long hash = 0;
    const cairo_path_buf_t *buf;
    int num_points, num_ops;

    hash = _cairo_hash_bytes (hash,
			 &path->current_point,
			 sizeof (path->current_point));
    hash = _cairo_hash_bytes (hash,
			 &path->last_move_point,
			 sizeof (path->last_move_point));

    num_ops = path->buf_head.base.num_ops;
    num_points = path->buf_head.base.num_points;
    for (buf = path->buf_head.base.next;
	 buf != NULL;
	 buf = buf->next)
    {
	hash = _cairo_hash_bytes (hash, buf->op,
			     buf->num_ops * sizeof (buf->op[0]));
	hash = _cairo_hash_bytes (hash, buf->points,
			     buf->num_points * sizeof (buf->points[0]));

	num_ops    += buf->num_ops;
	num_points += buf->num_points;
    }

    hash = _cairo_hash_bytes (hash, &num_ops, sizeof (num_ops));
    hash = _cairo_hash_bytes (hash, &num_points, sizeof (num_points));

    return hash;
}
Example #4
0
    int num_points, num_ops;

    hash = _cairo_hash_bytes (hash, &path->extents, sizeof (path->extents));

    num_ops = num_points = 0;
    cairo_path_foreach_buf_start (buf, path) {
	hash = _cairo_hash_bytes (hash, buf->op,
			          buf->num_ops * sizeof (buf->op[0]));
	hash = _cairo_hash_bytes (hash, buf->points,
			          buf->num_points * sizeof (buf->points[0]));

	num_ops    += buf->num_ops;
	num_points += buf->num_points;
    } cairo_path_foreach_buf_end (buf, path);

    hash = _cairo_hash_bytes (hash, &num_ops, sizeof (num_ops));
    hash = _cairo_hash_bytes (hash, &num_points, sizeof (num_points));

    return hash;
}

unsigned long
_cairo_path_fixed_size (const cairo_path_fixed_t *path)
{
    const cairo_path_buf_t *buf;
    int num_points, num_ops;

    num_ops = num_points = 0;
    cairo_path_foreach_buf_start (buf, path) {
	num_ops    += buf->num_ops;
	num_points += buf->num_points;