Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/engines/xrender_x11


Modified Files:
        evas_engine.c evas_engine.h evas_engine_xrender.c 


Log Message:


in theory support dest alpha

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/xrender_x11/evas_engine.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- evas_engine.c       2 Oct 2005 15:15:44 -0000       1.1
+++ evas_engine.c       3 Oct 2005 03:34:21 -0000       1.2
@@ -86,9 +86,11 @@
    Visual               *vis;
    Drawable              win;
    Pixmap                mask;
+   unsigned char         destination_alpha : 1;
    
    Ximage_Info          *xinf;
    Xrender_Surface      *output;
+   Xrender_Surface      *mask_output;
    
    Tilebuf              *tb;
    Tilebuf_Rect         *rects;
@@ -238,11 +240,18 @@
    re->vis = info->info.visual;
    re->win = info->info.drawable;
    re->mask = info->info.mask;
+   re->destination_alpha = info->info.destination_alpha;
+   
    if (re->xinf) _xr_image_info_free(re->xinf);
    re->xinf = _xr_image_info_get(re->disp, re->win, re->vis);
 
    if (re->output) _xr_render_surface_free(re->output);
    re->output = _xr_render_surface_adopt(re->xinf, re->win, e->output.w, 
e->output.h, 0);
+   if (re->mask)
+     {
+       if (re->mask_output) _xr_render_surface_free(re->mask_output);
+       re->mask_output = _xr_render_surface_format_adopt(re->xinf, re->win, 
e->output.w, e->output.h, re->xinf->fmt1, 1);
+     }
 }
 
 static void
@@ -256,6 +265,7 @@
    if (re->xinf) _xr_image_info_free(re->xinf);
    if (re->tb) evas_common_tilebuf_free(re->tb);
    if (re->output) _xr_render_surface_free(re->output);
+   if (re->mask_output) _xr_render_surface_free(re->mask_output);
    if (re->rects) evas_common_tilebuf_free_render_rects(re->rects);
    free(re);
 }
@@ -272,6 +282,11 @@
        if (re->output) _xr_render_surface_free(re->output);
      }
    re->output = _xr_render_surface_adopt(re->xinf, re->win, w, h, 0);
+   if (re->mask_output)
+     {
+       if (re->mask_output) _xr_render_surface_free(re->mask_output);
+       re->mask_output = _xr_render_surface_format_adopt(re->xinf, re->win, w, 
h, re->xinf->fmt1, 1);
+     }
    evas_common_tilebuf_free(re->tb);
    re->tb = evas_common_tilebuf_new(w, h);
    if (re->tb) evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
@@ -344,6 +359,8 @@
 
    *x = ux; *y = uy; *w = uw; *h = uh;
    *cx = 0; *cy = 0; *cw = uw; *ch = uh;
+   if ((re->destination_alpha)|| (re->mask))
+     return _xr_render_surface_new(re->xinf, uw, uh, re->xinf->fmt32, 1);
    return _xr_render_surface_new(re->xinf, uw, uh, re->xinf->fmt24, 0);
 }
 
@@ -353,8 +370,27 @@
    Render_Engine *re;
    
    re = (Render_Engine *)data;
-   _xr_render_surface_copy((Xrender_Surface *)surface, re->output, 0, 0,
-                          x, y, w, h);
+   if (re->mask_output)
+     {
+       Xrender_Surface *tsurf;
+       
+       _xr_render_surface_copy((Xrender_Surface *)surface, re->output, 0, 0,
+                               x, y, w, h);
+       tsurf = _xr_render_surface_new(re->xinf, w, h, re->xinf->fmt1, 1);
+       if (tsurf)
+         {
+            _xr_render_surface_copy((Xrender_Surface *)surface, tsurf, 0, 0,
+                                    0, 0, w, h);
+            _xr_render_surface_copy(tsurf, re->mask_output, 0, 0,
+                                    x, y, w, h);
+            _xr_render_surface_free(tsurf);
+         }
+     }
+   else
+     {
+       _xr_render_surface_copy((Xrender_Surface *)surface, re->output, 0, 0,
+                               x, y, w, h);
+     }
    _xr_render_surface_free((Xrender_Surface *)surface);
 }
 
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/xrender_x11/evas_engine.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- evas_engine.h       2 Oct 2005 15:15:44 -0000       1.1
+++ evas_engine.h       3 Oct 2005 03:34:21 -0000       1.2
@@ -68,6 +68,7 @@
 /* xrender support calls */
 Xrender_Surface *_xr_render_surface_new(Ximage_Info *xinf, int w, int h, 
XRenderPictFormat *fmt, int alpha);
 Xrender_Surface *_xr_render_surface_adopt(Ximage_Info *xinf, Drawable draw, 
int w, int h, int alpha);
+Xrender_Surface *_xr_render_surface_format_adopt(Ximage_Info *xinf, Drawable 
draw, int w, int h, XRenderPictFormat *fmt, int alpha);
 void             _xr_render_surface_free(Xrender_Surface *rs);
 void             _xr_render_surface_repeat_set(Xrender_Surface *rs, int 
repeat);
 void             _xr_render_surface_solid_rectangle_set(Xrender_Surface *rs, 
int r, int g, int b, int a, int x, int y, int w, int h);
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/xrender_x11/evas_engine_xrender.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- evas_engine_xrender.c       2 Oct 2005 15:15:44 -0000       1.1
+++ evas_engine_xrender.c       3 Oct 2005 03:34:21 -0000       1.2
@@ -42,6 +42,30 @@
    rs->fmt = fmt;
    rs->alpha = alpha;
    rs->depth = fmt->depth;
+   if (fmt->depth == 32) rs->alpha = 1;
+   rs->allocated = 0;
+   rs->draw = draw;
+   att.dither = 1;
+   att.component_alpha = 1;
+   att.repeat = 0;
+   rs->pic = XRenderCreatePicture(xinf->disp, rs->draw, fmt, CPRepeat | 
CPDither | CPComponentAlpha, &att);
+   return rs;
+}
+
+Xrender_Surface *
+_xr_render_surface_format_adopt(Ximage_Info *xinf, Drawable draw, int w, int 
h, XRenderPictFormat *fmt, int alpha)
+{
+   Xrender_Surface *rs;
+   XRenderPictureAttributes att;
+   
+   rs = calloc(1, sizeof(Xrender_Surface));
+   rs->xinf = xinf;
+   rs->w = w;
+   rs->h = h;
+   rs->fmt = fmt;
+   rs->alpha = alpha;
+   rs->depth = fmt->depth;
+   if (fmt->depth == 32) rs->alpha = 1;
    rs->allocated = 0;
    rs->draw = draw;
    att.dither = 1;




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to