mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-26 15:30:25 +01:00
Use surface_transform in replay_and_create_regions
The surface_transform was already used surface_replay_with_clip, as the
matrix is obviously needed for the clip. But now, because of the
optimization done in commit 09b42c7, it's also needed by
replay_and_create_regions: get_target_extents clips the target surface
for performance issues, and therefore needs the surface_transform matrix
to get the right clipping surface.
Signed-off-by: Guillaume Ayoub <guillaume.ayoub@kozea.fr>
This commit is contained in:
parent
747cab741c
commit
d2f1ebf579
4 changed files with 8 additions and 4 deletions
|
|
@ -144,7 +144,7 @@ _analyze_recording_surface_pattern (cairo_analysis_surface_t *surface,
|
|||
const cairo_surface_pattern_t *surface_pattern;
|
||||
cairo_analysis_surface_t *tmp;
|
||||
cairo_surface_t *source, *proxy;
|
||||
cairo_matrix_t p2d;
|
||||
cairo_matrix_t p2d, surface_transform;
|
||||
cairo_status_t status, analysis_status;
|
||||
|
||||
assert (pattern->type == CAIRO_PATTERN_TYPE_SURFACE);
|
||||
|
|
@ -171,9 +171,11 @@ _analyze_recording_surface_pattern (cairo_analysis_surface_t *surface,
|
|||
cairo_matrix_multiply (&tmp->ctm, &p2d, &surface->ctm);
|
||||
tmp->has_ctm = ! _cairo_matrix_is_identity (&tmp->ctm);
|
||||
|
||||
surface_transform = tmp->ctm;
|
||||
status = cairo_matrix_invert (&surface_transform);
|
||||
source = _cairo_surface_get_source (source, NULL);
|
||||
status = _cairo_recording_surface_replay_and_create_regions (source,
|
||||
&tmp->base);
|
||||
&surface_transform, &tmp->base);
|
||||
analysis_status = tmp->has_unsupported ? CAIRO_INT_STATUS_IMAGE_FALLBACK : CAIRO_INT_STATUS_SUCCESS;
|
||||
detach_proxy (proxy);
|
||||
cairo_surface_destroy (&tmp->base);
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ _paint_page (cairo_paginated_surface_t *surface)
|
|||
surface->backend->set_paginated_mode (surface->target,
|
||||
CAIRO_PAGINATED_MODE_ANALYZE);
|
||||
status = _cairo_recording_surface_replay_and_create_regions (surface->recording_surface,
|
||||
analysis);
|
||||
NULL, analysis);
|
||||
if (status)
|
||||
goto FAIL;
|
||||
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@ _cairo_recording_surface_replay_with_clip (cairo_surface_t *surface,
|
|||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_recording_surface_replay_and_create_regions (cairo_surface_t *surface,
|
||||
const cairo_matrix_t *surface_transform,
|
||||
cairo_surface_t *target);
|
||||
cairo_private cairo_status_t
|
||||
_cairo_recording_surface_replay_region (cairo_surface_t *surface,
|
||||
|
|
|
|||
|
|
@ -2026,9 +2026,10 @@ _cairo_recording_surface_replay_with_clip (cairo_surface_t *surface,
|
|||
*/
|
||||
cairo_status_t
|
||||
_cairo_recording_surface_replay_and_create_regions (cairo_surface_t *surface,
|
||||
const cairo_matrix_t *surface_transform,
|
||||
cairo_surface_t *target)
|
||||
{
|
||||
return _cairo_recording_surface_replay_internal ((cairo_recording_surface_t *) surface, NULL, NULL,
|
||||
return _cairo_recording_surface_replay_internal ((cairo_recording_surface_t *) surface, NULL, surface_transform,
|
||||
target, NULL,
|
||||
CAIRO_RECORDING_CREATE_REGIONS,
|
||||
CAIRO_RECORDING_REGION_ALL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue