[PATCH] add "surface_transform" parameter to "replay_and_create_regions" function
Guillaume Ayoub <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <1371723086.20939.16.camel@liZe76> |
This patch adds a "surface_transform" parameter to the "replay_and_create_regions" function. It was already done in 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. I can provide further information if needed. This patch had already been submitted in May (http://lists.cairographics.org/archives/cairo/2013-May/024301.html), I send it again with an appropriate subject. -- Guillaume -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo
cairo-fix-extents.patch
(text/x-patch, 3.2 KB)
diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c
index 8516094..d3afd9f 100644
--- a/src/cairo-analysis-surface.c
+++ b/src/cairo-analysis-surface.c
@@ -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);
diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c
index fe9ccee..8371474 100644
--- a/src/cairo-paginated-surface.c
+++ b/src/cairo-paginated-surface.c
@@ -354,7 +354,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;
diff --git a/src/cairo-recording-surface-private.h b/src/cairo-recording-surface-private.h
index 0235b0f..aee7887 100644
--- a/src/cairo-recording-surface-private.h
+++ b/src/cairo-recording-surface-private.h
@@ -167,6 +167,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,
diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c
index c6d34c0..0f1a06d 100644
--- a/src/cairo-recording-surface.c
+++ b/src/cairo-recording-surface.c
@@ -1917,9 +1917,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);
signature.asc
(application/pgp-signature, 490 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) iQEcBAABAgAGBQJRwtVPAAoJEFDXmmt3d/ODwjQH/RiFiAMAxZIqgTp5/0/tJHuq WKWuRGcfneViyIJ594X3NphaIG/ImKMbooOmHcVUzLlF/EvywFT9StWjwppRrSXy KlXKO6tC0dKrj3+6UPzIrelrDHJ+yCMm85ljwJPs+BkPHDc3GtZrHOKJimb0j5lZ 5njpnqpqiiaY7Begt6gSc+TkUDcU9PweqT3PlsWCMgtco7JlWKck+ENzxVoOXGeG HlCNNxG+Yt0lyIafr6MPv4wqSMX4UV98RshdR4DLkWoXUVfmbypEzevQ/cQbbPS4 B/xbXiuBBcEASCzxZvpzkTrj2OMxqph1fQ77TO/dKMj7YWSSxEMt24ZnY1PhcKU= =cyAH -----END PGP SIGNATURE-----