Author: lewing
Date: 2007-10-08 12:56:09 -0400 (Mon, 08 Oct 2007)
New Revision: 87109

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/rect.cpp
   trunk/moon/src/runtime.cpp
Log:
2007-10-08  Larry Ewing  <[EMAIL PROTECTED]>

        * src/runtime.cpp: draw the background color blended over white.


Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-10-08 16:51:38 UTC (rev 87108)
+++ trunk/moon/src/ChangeLog    2007-10-08 16:56:09 UTC (rev 87109)
@@ -1,5 +1,9 @@
 2007-10-08  Larry Ewing  <[EMAIL PROTECTED]>
 
+       * src/runtime.cpp: draw the background color blended over white.
+
+2007-10-08  Larry Ewing  <[EMAIL PROTECTED]>
+
        * media.cpp: render clip paths on media elements.
 
 2007-10-07  Larry Ewing  <[EMAIL PROTECTED]>

Modified: trunk/moon/src/rect.cpp
===================================================================
--- trunk/moon/src/rect.cpp     2007-10-08 16:51:38 UTC (rev 87108)
+++ trunk/moon/src/rect.cpp     2007-10-08 16:56:09 UTC (rev 87109)
@@ -24,7 +24,6 @@
                       g_array_index (values, double, 3));
        
        g_array_free (values, true);
-
        return r;
 }
 

Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp  2007-10-08 16:51:38 UTC (rev 87108)
+++ trunk/moon/src/runtime.cpp  2007-10-08 16:56:09 UTC (rev 87109)
@@ -768,12 +768,16 @@
                cairo_paint (ctx);
        }
        else if (s->background_color) {
+               // Here since we are not transparent we start with a white
+               // background and blend the specified background on top of
+               // it.  Alternatively we could let gtk fill the background
+               // but we need a test case first.
                cairo_set_operator (ctx, CAIRO_OPERATOR_SOURCE);
-               cairo_set_source_rgba (ctx,
-                                      s->background_color->r * 
s->background_color->a,
-                                      s->background_color->g * 
s->background_color->a,
-                                      s->background_color->b * 
s->background_color->a,
-                                      s->background_color->a);
+               double base = 1.0 - s->background_color->a;
+               cairo_set_source_rgb (ctx,
+                                     base + s->background_color->r * 
s->background_color->a,
+                                     base + s->background_color->g * 
s->background_color->a,
+                                     base + s->background_color->b * 
s->background_color->a);
                cairo_paint (ctx);
        }
 

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

Reply via email to