mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-10 18:20:39 +01:00
[meta] Use the pre-computed device_transform_inverse.
Avoid repeatedly inverting the same matrix by using the pre-computed inverse.
This commit is contained in:
parent
523f725801
commit
f916e2178b
1 changed files with 6 additions and 10 deletions
|
|
@ -844,14 +844,12 @@ _cairo_meta_surface_replay_internal (cairo_surface_t *surface,
|
|||
{
|
||||
cairo_matrix_t dev_ctm = command->stroke.ctm;
|
||||
cairo_matrix_t dev_ctm_inverse = command->stroke.ctm_inverse;
|
||||
cairo_matrix_t tmp;
|
||||
|
||||
if (has_device_transform) {
|
||||
cairo_matrix_multiply (&dev_ctm, &dev_ctm, device_transform);
|
||||
tmp = surface->device_transform;
|
||||
status = cairo_matrix_invert (&tmp);
|
||||
assert (status == CAIRO_STATUS_SUCCESS);
|
||||
cairo_matrix_multiply (&dev_ctm_inverse, &tmp, &dev_ctm_inverse);
|
||||
cairo_matrix_multiply (&dev_ctm_inverse,
|
||||
&surface->device_transform_inverse,
|
||||
&dev_ctm_inverse);
|
||||
}
|
||||
|
||||
status = _cairo_surface_stroke (target,
|
||||
|
|
@ -885,17 +883,15 @@ _cairo_meta_surface_replay_internal (cairo_surface_t *surface,
|
|||
_cairo_path_fixed_is_equal (dev_path, _cairo_command_get_path (stroke_command))) {
|
||||
cairo_matrix_t dev_ctm;
|
||||
cairo_matrix_t dev_ctm_inverse;
|
||||
cairo_matrix_t tmp;
|
||||
|
||||
dev_ctm = stroke_command->stroke.ctm;
|
||||
dev_ctm_inverse = stroke_command->stroke.ctm_inverse;
|
||||
|
||||
if (has_device_transform) {
|
||||
cairo_matrix_multiply (&dev_ctm, &dev_ctm, device_transform);
|
||||
tmp = surface->device_transform;
|
||||
status = cairo_matrix_invert (&tmp);
|
||||
assert (status == CAIRO_STATUS_SUCCESS);
|
||||
cairo_matrix_multiply (&dev_ctm_inverse, &tmp, &dev_ctm_inverse);
|
||||
cairo_matrix_multiply (&dev_ctm_inverse,
|
||||
&surface->device_transform_inverse,
|
||||
&dev_ctm_inverse);
|
||||
}
|
||||
|
||||
status = _cairo_surface_fill_stroke (target,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue