[cairo-commit] src/cairo-quartz-surface.c
Jeff Muizelaar
jrmuizel at kemper.freedesktop.org
Tue Dec 9 12:39:00 PST 2008
- Previous message: [cairo-commit] src/cairoint.h
- Next message: [cairo-commit] pycairo RELEASING, 1.22, 1.23 configure.ac, 1.73, 1.74 Makefile.am, 1.20, 1.21 README, 1.34, 1.35 setup.py, 1.26, 1.27
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
src/cairo-quartz-surface.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
New commits:
commit db4c427e8460b0e326691bd6d3784178a713eb33
Author: Jeff Muizelaar <jmuizelaar at mozilla.com>
Date: Tue Dec 9 12:03:11 2008 -0500
[quartz] Change some pattern casts to access to the base class
Avoiding casts gives us some more type safety.
diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 9f6b245..17fabe0 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -1072,7 +1072,7 @@ static cairo_quartz_action_t
_cairo_quartz_setup_linear_source (cairo_quartz_surface_t *surface,
cairo_linear_pattern_t *lpat)
{
- cairo_pattern_t *abspat = (cairo_pattern_t *) lpat;
+ cairo_pattern_t *abspat = &lpat->base.base;
cairo_matrix_t mat;
CGPoint start, end;
CGFunctionRef gradFunc;
@@ -1099,10 +1099,10 @@ _cairo_quartz_setup_linear_source (cairo_quartz_surface_t *surface,
if (abspat->extend == CAIRO_EXTEND_NONE ||
abspat->extend == CAIRO_EXTEND_PAD)
{
- gradFunc = CreateGradientFunction ((cairo_gradient_pattern_t*) lpat);
+ gradFunc = CreateGradientFunction (&lpat->base);
} else {
gradFunc = CreateRepeatingGradientFunction (surface,
- (cairo_gradient_pattern_t*) lpat,
+ &lpat->base,
&start, &end, surface->sourceTransform);
}
@@ -1121,7 +1121,7 @@ static cairo_quartz_action_t
_cairo_quartz_setup_radial_source (cairo_quartz_surface_t *surface,
cairo_radial_pattern_t *rpat)
{
- cairo_pattern_t *abspat = (cairo_pattern_t *)rpat;
+ cairo_pattern_t *abspat = &rpat->base.base;
cairo_matrix_t mat;
CGPoint start, end;
CGFunctionRef gradFunc;
@@ -1142,7 +1142,7 @@ _cairo_quartz_setup_radial_source (cairo_quartz_surface_t *surface,
* Radial shadings). So, instead, let's just render an image
* for pixman to draw the shading into, and use that.
*/
- return _cairo_quartz_setup_fallback_source (surface, (cairo_pattern_t*) rpat);
+ return _cairo_quartz_setup_fallback_source (surface, &rpat->base.base);
}
cairo_pattern_get_matrix (abspat, &mat);
@@ -1156,7 +1156,7 @@ _cairo_quartz_setup_radial_source (cairo_quartz_surface_t *surface,
end = CGPointMake (_cairo_fixed_to_double (rpat->c2.x),
_cairo_fixed_to_double (rpat->c2.y));
- gradFunc = CreateGradientFunction ((cairo_gradient_pattern_t*) rpat);
+ gradFunc = CreateGradientFunction (&rpat->base);
surface->sourceShading = CGShadingCreateRadial (rgb,
start,
- Previous message: [cairo-commit] src/cairoint.h
- Next message: [cairo-commit] pycairo RELEASING, 1.22, 1.23 configure.ac, 1.73, 1.74 Makefile.am, 1.20, 1.21 README, 1.34, 1.35 setup.py, 1.26, 1.27
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cairo-commit
mailing list