[cairo-commit] 2 commits - src/cairo-gstate.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 26 16:04:25 UTC 2021


 src/cairo-gstate.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 816e7ac06f33f9fbc446297b601f1ffe2c63801b
Merge: f125a457e 8d0274413
Author: Uli Schlachter <psychon at znc.in>
Date:   Mon Apr 26 16:04:23 2021 +0000

    Merge branch 'fix-cairo-gstate-copy-transformed-pattern-comment' into 'master'
    
    Replace an outdated (after f0e2cd44) comment with clarification in _cairo_gstate_copy_transformed_pattern
    
    See merge request cairo/cairo!162

commit 8d0274413667039ee46a26a4b8abe1ae2bbd1c28
Author: Anton Danilkin <afdw at yandex.ru>
Date:   Sat Apr 24 14:55:19 2021 +0200

    Replace an outdated (after f0e2cd44) comment with clarification in _cairo_gstate_copy_transformed_pattern

diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index ff0cb8be7..a5f6fc72f 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -937,9 +937,22 @@ _cairo_gstate_copy_transformed_pattern (cairo_gstate_t  *gstate,
 					const cairo_pattern_t *original,
 					const cairo_matrix_t  *ctm_inverse)
 {
+    /*
+     * What calculations below do can be described in pseudo-code (so using nonexistent fields) as (using column vectors):
+     * pattern->matrix = surface->device_transform *
+     * 			 pattern->matrix *
+     * 			 ctm_inverse *
+     * 			 gstate->target->device_transform_inverse
+     *
+     * The inverse of which is:
+     * pattern->matrix_inverse = gstate->target->device_transform *
+     * 				 ctm *
+     * 				 pattern->matrix_inverse *
+     * 				 surface->device_transform_inverse
+     */
+
     _cairo_gstate_copy_pattern (pattern, original);
 
-    /* apply device_transform first so that it is transformed by ctm_inverse */
     if (original->type == CAIRO_PATTERN_TYPE_SURFACE) {
 	cairo_surface_pattern_t *surface_pattern;
 	cairo_surface_t *surface;


More information about the cairo-commit mailing list