Beispiel #1
0
int fz_reset_rasterizer(fz_context *ctx, fz_rasterizer *rast, fz_irect clip)
{
	const int hscale = fz_rasterizer_aa_hscale(rast);
	const int vscale = fz_rasterizer_aa_vscale(rast);

	if (fz_is_infinite_irect(clip))
	{
		rast->clip.x0 = rast->clip.y0 = BBOX_MIN;
		rast->clip.x1 = rast->clip.y1 = BBOX_MAX;
	}
	else {
		rast->clip.x0 = clip.x0 * hscale;
		rast->clip.x1 = clip.x1 * hscale;
		rast->clip.y0 = clip.y0 * vscale;
		rast->clip.y1 = clip.y1 * vscale;
	}

	rast->bbox.x0 = rast->bbox.y0 = BBOX_MAX;
	rast->bbox.x1 = rast->bbox.y1 = BBOX_MIN;
	if (rast->fns.reset)
		return rast->fns.reset(ctx, rast);
	return 0;
}
Beispiel #2
0
void
fz_reset_gel(fz_context *ctx, fz_gel *gel, const fz_irect *clip)
{
	const int hscale = fz_aa_hscale;
	const int vscale = fz_aa_vscale;

	if (fz_is_infinite_irect(clip))
	{
		gel->clip.x0 = gel->clip.y0 = BBOX_MIN;
		gel->clip.x1 = gel->clip.y1 = BBOX_MAX;
	}
	else {
		gel->clip.x0 = clip->x0 * hscale;
		gel->clip.x1 = clip->x1 * hscale;
		gel->clip.y0 = clip->y0 * vscale;
		gel->clip.y1 = clip->y1 * vscale;
	}

	gel->bbox.x0 = gel->bbox.y0 = BBOX_MAX;
	gel->bbox.x1 = gel->bbox.y1 = BBOX_MIN;

	gel->len = 0;
	gel->alen = 0;
}