[cairo-commit] src/cairo-directfb-surface.c

Claudio Ciccani klan at kemper.freedesktop.org
Wed Jan 2 06:10:22 PST 2008


 src/cairo-directfb-surface.c |   25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

New commits:
commit ad0a2524ffdc9cc949d11de3aa51c429f13e12b7
Author: Claudio Ciccani <klan at directfb.org>
Date:   Wed Jan 2 15:09:58 2008 +0100

    [cairo-directfb] Optimize blend functions in fill_rectangles(), too.

diff --git a/src/cairo-directfb-surface.c b/src/cairo-directfb-surface.c
index e63d1ff..2c57a97 100644
--- a/src/cairo-directfb-surface.c
+++ b/src/cairo-directfb-surface.c
@@ -94,7 +94,7 @@ typedef struct _cairo_directfb_surface {
     int                  width;
     int                  height;
     
-    bool                 local;
+    cairo_bool_t         local;
 } cairo_directfb_surface_t;
 
 
@@ -1058,6 +1058,29 @@ _cairo_directfb_surface_fill_rectangles (void                  *abstract_surface
 
     if (_directfb_get_operator (op, &sblend, &dblend))
         return CAIRO_INT_STATUS_UNSUPPORTED;
+        
+    if (color->alpha_short >= 0xff00) {
+        if (sblend == DSBF_SRCALPHA)
+            sblend = DSBF_ONE;
+        else if (sblend == DSBF_INVSRCALPHA)
+            sblend = DSBF_ZERO;
+            
+        if (dblend == DSBF_SRCALPHA)
+            dblend = DSBF_ONE;
+        else if (dblend == DSBF_INVSRCALPHA)
+            dblend = DSBF_ZERO;
+    }
+    if (dst->content == CAIRO_CONTENT_COLOR) {
+        if (sblend == DSBF_DESTALPHA)
+            sblend = DSBF_ONE;
+        else if (sblend == DSBF_INVDESTALPHA)
+            sblend = DSBF_ZERO;
+         
+        if (dblend == DSBF_DESTALPHA)
+            dblend = DSBF_ONE;
+        else if (dblend == DSBF_INVDESTALPHA)
+            dblend = DSBF_ZERO;   
+    }
     
     flags = (sblend == DSBF_ONE && dblend == DSBF_ZERO) ? DSDRAW_NOFX : DSDRAW_BLEND;
     dst->dfbsurface->SetDrawingFlags (dst->dfbsurface, flags);


More information about the cairo-commit mailing list