summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2006-04-20 16:35:41 +0000
committerMurray Cumming <murrayc@murrayc.com>2006-04-20 16:35:41 +0000
commit4c21fec35f15c33dd6a5fadf35efe1266b0fb952 (patch)
tree3df88c6da6b977efddd7de6aefe2c303acfef30b
parent9375afe8d17efc60c95fce679a2c3feed44a50f7 (diff)
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.
-rw-r--r--ChangeLog6
-rw-r--r--cairomm/context.cc8
-rw-r--r--cairomm/context.h4
3 files changed, 12 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index bf5ce39..6a8b54c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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(),