[cairo-commit] cairomm/cairomm context.cc, 1.11, 1.12 context.h, 1.12, 1.13

Murray Cumming commit at pdx.freedesktop.org
Thu Apr 20 09:35:43 PDT 2006


Committed by: murrayc

Update of /cvs/cairo/cairomm/cairomm
In directory kemper:/tmp/cvs-serv391/cairomm

Modified Files:
	context.cc context.h 
Log Message:
2006-04-20  Murray Cumming  <murrayc at 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.


Index: context.cc
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/context.cc,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- context.cc	6 Mar 2006 17:55:51 -0000	1.11
+++ context.cc	20 Apr 2006 16:35:41 -0000	1.12
@@ -301,15 +301,15 @@
   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);
 }
 

Index: context.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/context.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- context.h	6 Mar 2006 17:55:51 -0000	1.12
+++ context.h	20 Apr 2006 16:35:41 -0000	1.13
@@ -554,7 +554,7 @@
    *
    * @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 @@
    * @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(),



More information about the cairo-commit mailing list