Enlightenment CVS committal

Author  : xcomputerman
Project : e17
Module  : proto

Dir     : e17/proto/esmart/src/trans


Modified Files:
        esmart_trans.c 


Log Message:
This should work fine with tiled backgrounds now.

SURGEON GENERAL'S WARNING: Fake transparency is hazardous to your health


===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/esmart/src/trans/esmart_trans.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- esmart_trans.c      8 Dec 2003 03:54:38 -0000       1.4
+++ esmart_trans.c      9 Dec 2003 04:43:48 -0000       1.5
@@ -49,6 +49,7 @@
 
   if((prop=XInternAtom(ecore_x_display_get(),"_XROOTPMAP_ID",True))!=None)
   {
+    /* FIXME: CACHE ME! */
     int ret=XGetWindowProperty(ecore_x_display_get(), 
                               RootWindow(ecore_x_display_get(), 0),
                                prop, 0L, 1L, False, AnyPropertyType, &type,
@@ -66,9 +67,6 @@
         fprintf(stderr,"bg_ebg_trans: transparency update %3d,%3d %3dx%3d\n",x,y,w,h);
 #  endif
 
-        imlib_context_set_display(ecore_x_display_get());
-        
imlib_context_set_visual(DefaultVisual(ecore_x_display_get(),DefaultScreen(ecore_x_display_get())));
-        
imlib_context_set_colormap(DefaultColormap(ecore_x_display_get(),DefaultScreen(ecore_x_display_get())));
         imlib_context_set_drawable(*((Pixmap *)data));
 
        if((x>=px)&&(y>=py)&&((x+w)<=(py+((signed int)pw)))&&((y+h)<=(py+((signed 
int)ph)))) 
@@ -87,15 +85,25 @@
            imlib_image_clear();
            imlib_context_set_cliprect(0, 0, w, h);
 
-           dx = pw;
-           dy = ph;
-           dx = (x%dx);
-           dy = (y%dy);
-       imlib_blend_image_onto_image(im, 1, 0, 0, pw, ph, 0, 0, pw, ph);
-
-           for (sy = 0; sy < (h + dy);sy+=ph) 
-                  for (sx = 0; sx < (w + dx); sx += pw) 
-           imlib_image_copy_rect(0, 0, pw, ph, sx - dx, sy-dy);
+           dx = (x%pw);
+           dy = (y%ph);
+
+       /* There really ought to be a better way to do this, like
+        * negative coordinates, but I'm not sure those are valid */
+       imlib_blend_image_onto_image(im, 1, dx, dy, pw - dx, ph - dy, 
+                                    0, 0, pw - dx, ph - dy);
+       imlib_blend_image_onto_image(im, 1, 0, dy, dx, pw - dy,
+                                    pw - dx, 0, dx, ph -dy);
+       imlib_blend_image_onto_image(im, 1, dx, 0, pw - dx, dy,
+                                    0, ph - dy, pw - dx, dy);
+       imlib_blend_image_onto_image(im, 1, 0, 0, dx, dy,
+                                    pw - dx, ph - dy, dx, dy);
+                                    
+
+       for (sx = 0; sx < w; sx += pw)
+          for (sy = 0; sy < h; sy += ph)
+             if(sx || sy)
+              imlib_image_copy_rect(0, 0, pw, ph, sx, sy);
            
        imlib_context_set_image(im);
            imlib_free_image();
@@ -163,6 +171,10 @@
 esmart_trans_x11_new(Evas *e)
 {
   Evas_Object *x11_trans_object;
+  
+  imlib_context_set_display(ecore_x_display_get());
+  
imlib_context_set_visual(DefaultVisual(ecore_x_display_get(),DefaultScreen(ecore_x_display_get())));
+  
imlib_context_set_colormap(DefaultColormap(ecore_x_display_get(),DefaultScreen(ecore_x_display_get())));
   
   x11_trans_object = evas_object_smart_add(e,
                                _esmart_trans_x11_smart_get());




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to