[cairo-commit] 2 commits - src/cairo-stroke-style.c src/cairo-surface-wrapper.c
Benjamin Otte
company at kemper.freedesktop.org
Fri Nov 27 12:05:14 PST 2009
src/cairo-stroke-style.c | 2 -
src/cairo-surface-wrapper.c | 56 ++++++++++++++++++++++++++++++++++++--------
2 files changed, 47 insertions(+), 11 deletions(-)
New commits:
commit d58560bda8361bd25f1b2207ecfab4b331601045
Author: Benjamin Otte <otte at gnome.org>
Date: Fri Nov 27 21:04:55 2009 +0100
Satisfy make check
diff --git a/src/cairo-stroke-style.c b/src/cairo-stroke-style.c
index 2d1cfe4..36afeeb 100644
--- a/src/cairo-stroke-style.c
+++ b/src/cairo-stroke-style.c
@@ -185,7 +185,7 @@ _cairo_stroke_style_dash_stroked (const cairo_stroke_style_t *style)
* Verifies if _cairo_stroke_style_dash_approximate should be used to generate
* an approximation of the dash pattern in the specified style, when used for
* stroking a path with the given CTM and tolerance.
- * Always FALSE for non-dashed styles.
+ * Always %FALSE for non-dashed styles.
*/
cairo_bool_t
_cairo_stroke_style_dash_can_approximate (const cairo_stroke_style_t *style,
commit 16fffc5c05857896c03decdcebff7f1b5e582390
Author: Benjamin Otte <otte at gnome.org>
Date: Fri Nov 27 18:13:45 2009 +0100
Apply device transform in surface wrapper
diff --git a/src/cairo-surface-wrapper.c b/src/cairo-surface-wrapper.c
index 7cb08db..af1ef9c 100644
--- a/src/cairo-surface-wrapper.c
+++ b/src/cairo-surface-wrapper.c
@@ -72,15 +72,28 @@ _cairo_surface_wrapper_release_source_image (cairo_surface_wrapper_t *wrapper,
_cairo_surface_release_source_image (wrapper->target, image, image_extra);
}
+static void
+_cairo_surface_wrapper_transform_pattern (cairo_surface_wrapper_t *wrapper,
+ cairo_pattern_t *pattern,
+ const cairo_pattern_t *original)
+{
+ _cairo_pattern_init_static_copy (pattern, original);
+
+ if (_cairo_surface_has_device_transform (wrapper->target))
+ _cairo_pattern_transform (pattern,
+ &wrapper->target->device_transform_inverse);
+}
+
cairo_status_t
_cairo_surface_wrapper_paint (cairo_surface_wrapper_t *wrapper,
- cairo_operator_t op,
- const cairo_pattern_t *source,
- cairo_clip_t *clip)
+ cairo_operator_t op,
+ const cairo_pattern_t *source,
+ cairo_clip_t *clip)
{
cairo_status_t status;
cairo_matrix_t device_transform;
cairo_clip_t clip_copy, *dev_clip = clip;
+ cairo_pattern_union_t source_pattern;
if (unlikely (wrapper->target->status))
return wrapper->target->status;
@@ -104,7 +117,9 @@ _cairo_surface_wrapper_paint (cairo_surface_wrapper_t *wrapper,
dev_clip = &clip_copy;
}
- status = _cairo_surface_paint (wrapper->target, op, source, dev_clip);
+ _cairo_surface_wrapper_transform_pattern (wrapper, &source_pattern.base, source);
+
+ status = _cairo_surface_paint (wrapper->target, op, &source_pattern.base, dev_clip);
FINISH:
if (dev_clip != clip)
@@ -122,6 +137,7 @@ _cairo_surface_wrapper_mask (cairo_surface_wrapper_t *wrapper,
cairo_status_t status;
cairo_matrix_t device_transform;
cairo_clip_t clip_copy, *dev_clip = clip;
+ cairo_pattern_union_t source_pattern, mask_pattern;
if (unlikely (wrapper->target->status))
return wrapper->target->status;
@@ -145,7 +161,12 @@ _cairo_surface_wrapper_mask (cairo_surface_wrapper_t *wrapper,
dev_clip = &clip_copy;
}
- status = _cairo_surface_mask (wrapper->target, op, source, mask, dev_clip);
+ _cairo_surface_wrapper_transform_pattern (wrapper, &source_pattern.base, source);
+ _cairo_surface_wrapper_transform_pattern (wrapper, &mask_pattern.base, mask);
+
+ status = _cairo_surface_mask (wrapper->target, op,
+ &source_pattern.base, &mask_pattern.base,
+ dev_clip);
FINISH:
if (dev_clip != clip)
@@ -171,6 +192,7 @@ _cairo_surface_wrapper_stroke (cairo_surface_wrapper_t *wrapper,
cairo_clip_t clip_copy, *dev_clip = clip;
cairo_matrix_t dev_ctm = *ctm;
cairo_matrix_t dev_ctm_inverse = *ctm_inverse;
+ cairo_pattern_union_t source_pattern;
if (unlikely (wrapper->target->status))
return wrapper->target->status;
@@ -210,7 +232,9 @@ _cairo_surface_wrapper_stroke (cairo_surface_wrapper_t *wrapper,
}
}
- status = _cairo_surface_stroke (wrapper->target, op, source,
+ _cairo_surface_wrapper_transform_pattern (wrapper, &source_pattern.base, source);
+
+ status = _cairo_surface_stroke (wrapper->target, op, &source_pattern.base,
dev_path, stroke_style,
&dev_ctm, &dev_ctm_inverse,
tolerance, antialias,
@@ -247,6 +271,7 @@ _cairo_surface_wrapper_fill_stroke (cairo_surface_wrapper_t *wrapper,
cairo_clip_t clip_copy, *dev_clip = clip;
cairo_matrix_t dev_ctm = *stroke_ctm;
cairo_matrix_t dev_ctm_inverse = *stroke_ctm_inverse;
+ cairo_pattern_union_t fill_pattern, stroke_pattern;
if (unlikely (wrapper->target->status))
return wrapper->target->status;
@@ -286,11 +311,14 @@ _cairo_surface_wrapper_fill_stroke (cairo_surface_wrapper_t *wrapper,
}
}
+ _cairo_surface_wrapper_transform_pattern (wrapper, &fill_pattern.base, fill_source);
+ _cairo_surface_wrapper_transform_pattern (wrapper, &stroke_pattern.base, stroke_source);
+
status = _cairo_surface_fill_stroke (wrapper->target,
- fill_op, fill_source, fill_rule,
+ fill_op, &fill_pattern.base, fill_rule,
fill_tolerance, fill_antialias,
dev_path,
- stroke_op, stroke_source,
+ stroke_op, &stroke_pattern.base,
stroke_style,
&dev_ctm, &dev_ctm_inverse,
stroke_tolerance, stroke_antialias,
@@ -318,6 +346,7 @@ _cairo_surface_wrapper_fill (cairo_surface_wrapper_t *wrapper,
cairo_matrix_t device_transform;
cairo_path_fixed_t path_copy, *dev_path = path;
cairo_clip_t clip_copy, *dev_clip = clip;
+ cairo_pattern_union_t source_pattern;
if (unlikely (wrapper->target->status))
return wrapper->target->status;
@@ -350,7 +379,10 @@ _cairo_surface_wrapper_fill (cairo_surface_wrapper_t *wrapper,
}
}
- status = _cairo_surface_fill (wrapper->target, op, source,
+ _cairo_surface_wrapper_transform_pattern (wrapper, &source_pattern.base, source);
+
+ status = _cairo_surface_fill (wrapper->target, op,
+ &source_pattern.base,
dev_path, fill_rule,
tolerance, antialias,
dev_clip);
@@ -379,6 +411,7 @@ _cairo_surface_wrapper_show_text_glyphs (cairo_surface_wrapper_t *wrapper,
{
cairo_status_t status;
cairo_matrix_t device_transform;
+ cairo_pattern_union_t source_pattern;
cairo_clip_t clip_copy, *dev_clip = clip;
cairo_glyph_t *dev_glyphs = glyphs;
@@ -423,7 +456,10 @@ _cairo_surface_wrapper_show_text_glyphs (cairo_surface_wrapper_t *wrapper,
}
}
- status = _cairo_surface_show_text_glyphs (wrapper->target, op, source,
+ _cairo_surface_wrapper_transform_pattern (wrapper, &source_pattern.base, source);
+
+ status = _cairo_surface_show_text_glyphs (wrapper->target, op,
+ &source_pattern.base,
utf8, utf8_len,
dev_glyphs, num_glyphs,
clusters, num_clusters,
More information about the cairo-commit
mailing list