diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | cairomm/context.cc | 8 | ||||
-rw-r--r-- | cairomm/context.h | 4 |
3 files changed, 12 insertions, 6 deletions
@@ -1,3 +1,9 @@ +2006-04-20 Murray Cumming <murrayc@murrayc.com> + + * cairomm/context.cc: + * cairomm/context.h: mask(pattern) and mask(surface): Make the parameter + const, because I am fairly sure that the C function does not change it. + 2006-04-06 Jonathon Jongsma <jonathon.jongsma@gmail.com> * Makefile.am: Add a brief description of cairomm to the release diff --git a/cairomm/context.cc b/cairomm/context.cc index 0693343..c5d2bb8 100644 --- a/cairomm/context.cc +++ b/cairomm/context.cc @@ -301,15 +301,15 @@ void Context::paint_with_alpha(double alpha) check_object_status_and_throw_exception(*this); } -void Context::mask(const RefPtr<Pattern>& pattern) +void Context::mask(const RefPtr<const Pattern>& pattern) { - cairo_mask(m_cobject, pattern->cobj()); + cairo_mask(m_cobject, const_cast<cairo_pattern_t*>(pattern->cobj())); check_object_status_and_throw_exception(*this); } -void Context::mask(const RefPtr<Surface>& surface, double surface_x, double surface_y) +void Context::mask(const RefPtr<const Surface>& surface, double surface_x, double surface_y) { - cairo_mask_surface(m_cobject, surface->cobj(), surface_x, surface_y); + cairo_mask_surface(m_cobject, const_cast<cairo_surface_t*>(surface->cobj()), surface_x, surface_y); check_object_status_and_throw_exception(*this); } diff --git a/cairomm/context.h b/cairomm/context.h index 0ac2af3..cd7a2ba 100644 --- a/cairomm/context.h +++ b/cairomm/context.h @@ -554,7 +554,7 @@ public: * * @param pattern a Pattern */ - void mask(const RefPtr<Pattern>& pattern); + void mask(const RefPtr<const Pattern>& pattern); /** A drawing operator that paints the current source using the alpha channel * of surface as a mask. (Opaque areas of surface are painted with the @@ -564,7 +564,7 @@ public: * @param surface_x X coordinate at which to place the origin of surface * @param surface_y Y coordinate at which to place the origin of surface */ - void mask(const RefPtr<Surface>& surface, double surface_x, double surface_y); + void mask(const RefPtr<const Surface>& surface, double surface_x, double surface_y); /** A drawing operator that strokes the current Path according to the current * line width, line join, line cap, and dash settings. After stroke(), |