Author: lewing
Date: 2007-07-27 12:29:51 -0400 (Fri, 27 Jul 2007)
New Revision: 82870

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/uielement.cpp
Log:
2007-07-27  Larry Ewing  <[EMAIL PROTECTED]>

        * uielement.cpp: implement initial support for OpacityMask.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-07-27 16:16:16 UTC (rev 82869)
+++ trunk/moon/src/ChangeLog    2007-07-27 16:29:51 UTC (rev 82870)
@@ -1,3 +1,7 @@
+2007-07-27  Larry Ewing  <[EMAIL PROTECTED]>
+
+       * uielement.cpp: implement initial support for OpacityMask.
+
 2007-07-26  Miguel de Icaza  <[EMAIL PROTECTED]>
 
        This implements support for relative MediaElement sources and

Modified: trunk/moon/src/uielement.cpp
===================================================================
--- trunk/moon/src/uielement.cpp        2007-07-27 16:16:16 UTC (rev 82869)
+++ trunk/moon/src/uielement.cpp        2007-07-27 16:29:51 UTC (rev 82870)
@@ -372,8 +372,28 @@
 void
 UIElement::DoRender (cairo_t *cr, int x, int y, int width, int height)
 {
+
+       cairo_pattern_t *mask = NULL;
        STARTTIMER (UIElement_render, Type::Find (GetObjectType())->name);
+       if (opacityMask != NULL) {
+               cairo_save (cr);
+               opacityMask->SetupBrush (cr, this);
+               mask = cairo_get_source (cr);
+               cairo_pattern_reference (mask);
+               cairo_push_group (cr);
+       }
+       
        Render (cr, x, y, width, height);
+
+       if (opacityMask != NULL) {
+               cairo_pop_group_to_source (cr);
+               cairo_rectangle (cr, bounds.x + 1, bounds.y + 1, bounds.w - 2, 
bounds.h - 2);
+               cairo_clip (cr);
+               cairo_mask (cr, mask);
+               cairo_pattern_destroy (mask);
+               cairo_restore (cr);
+       }
+
        ENDTIMER (UIElement_render, Type::Find (GetObjectType())->name);
 
 #if SHOW_BOUNDING_BOXES

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to