[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[E-devel] xrender engine patch



    Attached is another small test patch for evas' xrender engine.

    jose.
Index: e17/libs/evas/src/lib/canvas/evas_object_image.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/lib/canvas/evas_object_image.c,v
retrieving revision 1.39
diff -u -r1.39 evas_object_image.c
--- e17/libs/evas/src/lib/canvas/evas_object_image.c	2 May 2006 07:28:46 -0000	1.39
+++ e17/libs/evas/src/lib/canvas/evas_object_image.c	16 May 2006 10:55:04 -0000
@@ -1389,6 +1389,9 @@
 	       }
 	     o->dirty_pixels = 0;
 	  }
+	o->engine_data = obj->layer->evas->engine.func->image_border_set(output, o->engine_data,
+									 o->cur.border.l, o->cur.border.r,
+									 o->cur.border.t, o->cur.border.b);
 	idx = evas_object_image_figure_x_fill(obj, o->cur.fill.x, o->cur.fill.w, &idw);
 	idy = evas_object_image_figure_y_fill(obj, o->cur.fill.y, o->cur.fill.h, &idh);
 	if (idw < 1.0) idw = 1.0;
Index: e17/libs/evas/src/lib/include/evas_private.h
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/lib/include/evas_private.h,v
retrieving revision 1.69
diff -u -r1.69 evas_private.h
--- e17/libs/evas/src/lib/include/evas_private.h	2 May 2006 07:28:48 -0000	1.69
+++ e17/libs/evas/src/lib/include/evas_private.h	16 May 2006 10:55:10 -0000
@@ -570,6 +570,8 @@
    void *(*image_data_put)                 (void *data, void *image, DATA32 *image_data);
    void *(*image_alpha_set)                (void *data, void *image, int has_alpha);
    int  (*image_alpha_get)                 (void *data, void *image);
+   void *(*image_border_set)               (void *data, void *image, int l, int r, int t, int b);
+   void  (*image_border_get)               (void *data, void *image, int *l, int *r, int *t, int *b);
    void (*image_draw)                      (void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth);
    char *(*image_comment_get)              (void *data, void *image, char *key);
    char *(*image_format_get)               (void *data, void *image);
Index: e17/libs/evas/src/modules/engines/cairo_x11/evas_engine.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/cairo_x11/evas_engine.c,v
retrieving revision 1.5
diff -u -r1.5 evas_engine.c
--- e17/libs/evas/src/modules/engines/cairo_x11/evas_engine.c	2 May 2006 07:28:48 -0000	1.5
+++ e17/libs/evas/src/modules/engines/cairo_x11/evas_engine.c	16 May 2006 10:55:14 -0000
@@ -69,6 +69,8 @@
 static void *eng_image_data_put(void *data, void *image, DATA32 *image_data);
 static void *eng_image_alpha_set(void *data, void *image, int has_alpha);
 static int eng_image_alpha_get(void *data, void *image);
+static void *eng_image_border_set(void *data, void *image, int l, int r, int t, int b);
+static void eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b);
 static void eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth);
 static char *eng_image_comment_get(void *data, void *image, char *key);
 static char *eng_image_format_get(void *data, void *image);
@@ -173,6 +175,8 @@
      eng_image_data_put,
      eng_image_alpha_set,
      eng_image_alpha_get,
+     eng_image_border_set,
+     eng_image_border_get,
      eng_image_draw,
      eng_image_comment_get,
      eng_image_format_get,
@@ -1036,6 +1040,24 @@
    return 0;
 }
 
+static void *
+eng_image_border_set(void *data, void *image, int l, int r, int t, int b)
+{
+   Render_Engine *re;
+
+   re = (Render_Engine *)data;
+   return image;
+}
+
+static void
+eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b)
+{
+   Render_Engine *re;
+
+   re = (Render_Engine *)data;
+   return;
+}
+
 static void
 eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
 {
Index: e17/libs/evas/src/modules/engines/directfb/evas_engine_dfb.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/directfb/evas_engine_dfb.c,v
retrieving revision 1.3
diff -u -r1.3 evas_engine_dfb.c
--- e17/libs/evas/src/modules/engines/directfb/evas_engine_dfb.c	2 May 2006 07:28:48 -0000	1.3
+++ e17/libs/evas/src/modules/engines/directfb/evas_engine_dfb.c	16 May 2006 10:55:20 -0000
@@ -69,6 +69,8 @@
    evas_engine_directfb_image_data_put,
    evas_engine_directfb_image_alpha_set,
    evas_engine_directfb_image_alpha_get,
+   evas_engine_directfb_image_border_set,
+   evas_engine_directfb_image_border_get,
    evas_engine_directfb_image_draw,
    evas_engine_directfb_image_comment_get,
    evas_engine_directfb_image_format_get,
Index: e17/libs/evas/src/modules/engines/directfb/evas_engine_dfb_image_objects.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/directfb/evas_engine_dfb_image_objects.c,v
retrieving revision 1.4
diff -u -r1.4 evas_engine_dfb_image_objects.c
--- e17/libs/evas/src/modules/engines/directfb/evas_engine_dfb_image_objects.c	18 Jan 2006 07:57:46 -0000	1.4
+++ e17/libs/evas/src/modules/engines/directfb/evas_engine_dfb_image_objects.c	16 May 2006 10:55:22 -0000
@@ -268,6 +268,22 @@
    return 0;
 }
 
+void  *
+evas_engine_directfb_image_border_set(void *data, void *image, int l, int r, int t, int b)
+{
+   return image;
+}
+
+void
+evas_engine_directfb_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b)
+{
+   Render_Engine      *re;
+   RGBA_Image         *im;
+
+   re = (Render_Engine *) data;
+   im = image;
+}
+
 void
 evas_engine_directfb_image_draw(void *data, void *context, void *surface,
 				void *image, int src_region_x, int src_region_y,
Index: e17/libs/evas/src/modules/engines/directfb/evas_engine_dfb_image_objects.h
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/directfb/evas_engine_dfb_image_objects.h,v
retrieving revision 1.1
diff -u -r1.1 evas_engine_dfb_image_objects.h
--- e17/libs/evas/src/modules/engines/directfb/evas_engine_dfb_image_objects.h	14 Jan 2006 12:13:37 -0000	1.1
+++ e17/libs/evas/src/modules/engines/directfb/evas_engine_dfb_image_objects.h	16 May 2006 10:55:23 -0000
@@ -30,6 +30,12 @@
 							 int has_alpha);
 int                 evas_engine_directfb_image_alpha_get(void *data,
 							 void *image);
+void               *evas_engine_directfb_image_border_set(void *data,
+							  void *image,
+							  int l, int r, int t, int b);
+void                evas_engine_directfb_image_border_get(void *data,
+							  void *image,
+							  int *l, int *r, int *t, int *b);
 void                evas_engine_directfb_image_draw(void *data, void *context,
 						    void *surface, void *image,
 						    int src_x, int src_y,
Index: e17/libs/evas/src/modules/engines/gl_x11/evas_engine.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/gl_x11/evas_engine.c,v
retrieving revision 1.11
diff -u -r1.11 evas_engine.c
--- e17/libs/evas/src/modules/engines/gl_x11/evas_engine.c	9 May 2006 11:40:10 -0000	1.11
+++ e17/libs/evas/src/modules/engines/gl_x11/evas_engine.c	16 May 2006 10:55:28 -0000
@@ -69,6 +69,8 @@
 static void *eng_image_data_put(void *data, void *image, DATA32 *image_data);
 static void *eng_image_alpha_set(void *data, void *image, int has_alpha);
 static int eng_image_alpha_get(void *data, void *image);
+static void *eng_image_border_set(void *data, void *image, int l, int r, int t, int b);
+static void eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b);
 static void eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth);
 static char *eng_image_comment_get(void *data, void *image, char *key);
 static char *eng_image_format_get(void *data, void *image);
@@ -179,6 +181,8 @@
      eng_image_data_put,
      eng_image_alpha_set,
      eng_image_alpha_get,
+     eng_image_border_set,
+     eng_image_border_get,
      eng_image_draw,
      eng_image_comment_get,
      eng_image_format_get,
@@ -998,6 +1002,24 @@
    return 0;
 }
 
+static void *
+eng_image_border_set(void *data, void *image, int l, int r, int t, int b)
+{
+   Render_Engine *re;
+
+   re = (Render_Engine *)data;
+   return image;
+}
+
+
+static void
+eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b)
+{
+   Render_Engine *re;
+
+   re = (Render_Engine *)data;
+}
+
 static void
 eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
 {
Index: e17/libs/evas/src/modules/engines/software_generic/evas_engine.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/software_generic/evas_engine.c,v
retrieving revision 1.3
diff -u -r1.3 evas_engine.c
--- e17/libs/evas/src/modules/engines/software_generic/evas_engine.c	2 May 2006 07:28:49 -0000	1.3
+++ e17/libs/evas/src/modules/engines/software_generic/evas_engine.c	16 May 2006 10:55:30 -0000
@@ -423,6 +423,23 @@
    return 0;
 }
 
+static void *
+eng_image_border_set(void *data, void *image, int l, int r, int t, int b)
+{
+   RGBA_Image *im;
+
+   im = image;
+   return im;
+}
+
+static void
+eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b)
+{
+   RGBA_Image *im;
+
+   im = image;
+}
+
 static void
 eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
 {
@@ -723,6 +740,8 @@
      eng_image_data_put,
      eng_image_alpha_set,
      eng_image_alpha_get,
+     eng_image_border_set,
+     eng_image_border_get,
      eng_image_draw,
      eng_image_comment_get,
      eng_image_format_get,
Index: e17/libs/evas/src/modules/engines/xrender_x11/evas_engine.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/xrender_x11/evas_engine.c,v
retrieving revision 1.8
diff -u -r1.8 evas_engine.c
--- e17/libs/evas/src/modules/engines/xrender_x11/evas_engine.c	2 May 2006 07:28:49 -0000	1.8
+++ e17/libs/evas/src/modules/engines/xrender_x11/evas_engine.c	16 May 2006 10:55:34 -0000
@@ -76,6 +76,8 @@
 static void *eng_image_data_put(void *data, void *image, DATA32 *image_data);
 static void *eng_image_alpha_set(void *data, void *image, int has_alpha);
 static int eng_image_alpha_get(void *data, void *image);
+static void *eng_image_border_set(void *data, void *image, int l, int r, int t, int b);
+static void eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b);
 static void eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth);
 static char *eng_image_comment_get(void *data, void *image, char *key);
 static char *eng_image_format_get(void *data, void *image);
@@ -657,6 +659,21 @@
    return _xre_image_alpha_get((XR_Image *)image);
 }
 
+static void *
+eng_image_border_set(void *data, void *image, int l, int r, int t, int b)
+{
+   if (!image) return image;
+   _xre_image_border_set((XR_Image *)image, l, r, t, b);
+   return image;
+}
+
+static void
+eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b)
+{
+   if (!image) return;
+   _xre_image_border_get((XR_Image *)image, l, r, t, b);
+}
+
 static void
 eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
 {
@@ -793,6 +810,8 @@
    ORD(image_data_put);
    ORD(image_alpha_set);
    ORD(image_alpha_get);
+   ORD(image_border_set);
+   ORD(image_border_get);
    ORD(image_draw);
    ORD(image_comment_get);
    ORD(image_format_get);
Index: e17/libs/evas/src/modules/engines/xrender_x11/evas_engine.h
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/xrender_x11/evas_engine.h,v
retrieving revision 1.2
diff -u -r1.2 evas_engine.h
--- e17/libs/evas/src/modules/engines/xrender_x11/evas_engine.h	2 May 2006 07:28:49 -0000	1.2
+++ e17/libs/evas/src/modules/engines/xrender_x11/evas_engine.h	16 May 2006 10:55:35 -0000
@@ -55,6 +55,7 @@
    Picture            pic;
    unsigned char      alpha : 1;
    unsigned char      allocated : 1;
+   unsigned char      bordered : 1;
 };
 
 /* ximage support calls (ximage vs xshmimage, cache etc.) */
@@ -117,6 +118,8 @@
 void      _xre_image_data_put(XR_Image *im, void *data);
 void      _xre_image_alpha_set(XR_Image *im, int alpha);
 int       _xre_image_alpha_get(XR_Image *im);
+void      _xre_image_border_set(XR_Image *im, int l, int r, int t, int b);
+void      _xre_image_border_get(XR_Image *im, int *l, int *r, int *t, int *b);
 void      _xre_image_surface_gen(XR_Image *im);
 void      _xre_image_cache_set(int size);
 int       _xre_image_cache_get(void);
Index: e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_gradient.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_gradient.c,v
retrieving revision 1.3
diff -u -r1.3 evas_engine_gradient.c
--- e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_gradient.c	11 May 2006 12:48:22 -0000	1.3
+++ e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_gradient.c	16 May 2006 10:55:35 -0000
@@ -164,7 +164,7 @@
 _xre_gradient_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, XR_Gradient *gr, int x, int y, int w, int h, double angle, int spread)
 {
    RGBA_Image *im;
-   int mul_use;
+   int  mul_use;
    
    if ((w <= 0) || (h <= 0)) return;
    if (!rs || !dc || !gr) return;
Index: e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_image.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_image.c,v
retrieving revision 1.4
diff -u -r1.4 evas_engine_image.c
--- e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_image.c	2 May 2006 07:28:49 -0000	1.4
+++ e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_image.c	16 May 2006 10:55:37 -0000
@@ -472,6 +472,29 @@
 }
 
 void
+_xre_image_border_set(XR_Image *im, int l, int r, int t, int b)
+{
+   if (!im) return;
+   _xre_image_surface_gen(im);
+   if (l < 1) l = 0;
+   if (r < 1) r = 0;
+   if (t < 1) t = 0;
+   if (b < 1) b = 0;
+   if (im->surface)
+     {
+	if (l | r | t | b)
+	  im->surface->bordered = 1;
+	else
+	  im->surface->bordered = 0;
+    }
+}
+
+void
+_xre_image_border_get(XR_Image *im, int *l, int *r, int *t, int *b)
+{
+}
+
+void
 _xre_image_surface_gen(XR_Image *im)
 {
    void *data = NULL;
Index: e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_xrender.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_xrender.c,v
retrieving revision 1.11
diff -u -r1.11 evas_engine_xrender.c
--- e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_xrender.c	16 May 2006 07:53:47 -0000	1.11
+++ e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_xrender.c	16 May 2006 10:55:40 -0000
@@ -336,18 +336,34 @@
 _xr_render_surface_composite(Xrender_Surface *srs, Xrender_Surface *drs, RGBA_Draw_Context *dc, int sx, int sy, int sw, int sh, int x, int y, int w, int h, int smooth)
 {
    Xrender_Surface *trs = NULL;
-   XTransform xf;
+   XTransform xf, id;
    XRenderPictureAttributes att;
    Picture mask;
    int r, g, b, a, op;
-   int sf;
+   int e;
 
    if ((sw <= 0) || (sh <= 0) || (w <= 0) || (h <= 0)) return;
    
+   e = 0;
+   if ((sw != w) || (sh != h))
+      e = 1;
+
    att.clip_mask = None;
    XRenderChangePicture(srs->xinf->disp, srs->pic, CPClipMask, &att);
    XRenderChangePicture(srs->xinf->disp, drs->pic, CPClipMask, &att);
    
+   id.matrix[0][0] = 1 << 16;
+   id.matrix[0][1] = 0;
+   id.matrix[0][2] = 0;
+ 
+   id.matrix[1][0] = 0;
+   id.matrix[1][1] = 1 << 16;
+   id.matrix[1][2] = 0;
+ 
+   id.matrix[2][0] = 0;
+   id.matrix[2][1] = 0;
+   id.matrix[2][2] = 1 << 16;
+
    op = PictOpSrc;
    if (srs->alpha) op = PictOpOver;
    mask = None;
@@ -367,86 +383,57 @@
 		  srs->xinf->mul_b = b;
 		  srs->xinf->mul_a = a;
 		  _xr_render_surface_solid_rectangle_set(srs->xinf->mul, 
-							 r, 
-							 g, 
-							 b, 
-							 a, 
+							 r, g, b, a, 
 							 0, 0, 1, 1);
 	       }
-	     att.component_alpha = 1;
 	     op = PictOpOver;
 	     mask = srs->xinf->mul->pic;
-	     XRenderChangePicture(srs->xinf->disp, mask, CPComponentAlpha, &att);
 	     if ((r == g == b == 0xff) && (a != 0xff))
 	       {
+		 att.component_alpha = 0;
+		 XRenderChangePicture(srs->xinf->disp, mask, CPComponentAlpha, &att);
 	       }
 	     else
 	       {
-		  xf.matrix[0][0] = 1 << 16;
-		  xf.matrix[0][1] = 0;
-		  xf.matrix[0][2] = 0;
-		  
-		  xf.matrix[1][0] = 0;
-		  xf.matrix[1][1] = 1 << 16;
-		  xf.matrix[1][2] = 0;
-		  
-		  xf.matrix[2][0] = 0;
-		  xf.matrix[2][1] = 0;
-		  xf.matrix[2][2] = 1 << 16;
 		  if ((srs->alpha) || (a != 0xff))
-		    trs = _xr_render_surface_new(srs->xinf, sw + 1, sh + 1,
-//		    trs = _xr_render_surface_new(srs->xinf, sw, sh,
+		    trs = _xr_render_surface_new(srs->xinf, sw + e, sh + e,
 						 srs->xinf->fmt32, 1);
 		  else
-		    trs = _xr_render_surface_new(srs->xinf, sw + 1, sh + 1,
-//		    trs = _xr_render_surface_new(srs->xinf, sw, sh,
+		    trs = _xr_render_surface_new(srs->xinf, sw + e, sh + e,
 						 srs->fmt, srs->alpha);
-		  XRenderSetPictureTransform(srs->xinf->disp, srs->pic, &xf);
+		  if (!trs) return;
+
+		  att.component_alpha = 1;
+		  XRenderChangePicture(srs->xinf->disp, mask, CPComponentAlpha, &att);
+		  XRenderSetPictureTransform(srs->xinf->disp, srs->pic, &id);
 		  XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
 				   trs->pic, sx, sy, 0, 0, 0, 0, sw, sh);
 		  /* fill right and bottom pixel so interpolation works right */
-		  XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
-				   trs->pic, sx + sw, sy, 0, 0, sw, 0, 1, sh);
-		  XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
-				   trs->pic, sx, sy + sh, 0, 0, 0, sh, sw + 1, 1);
-//		  XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
-//				   trs->pic, sx + sw, sy + sh, 0, 0, sw, sh, 1, 1);
-		  mask = 0;
+		  if (e)
+		    {
+		      XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
+				       trs->pic, sx + sw - 1, sy, 0, 0, sw, 0, 1, sh);
+		      XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
+				       trs->pic, sx, sy + sh - 1, 0, 0, 0, sh, sw, 1);
+		      XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
+				       trs->pic, sx + sw - 1, sy + sh - 1, 0, 0, sw, sh, 1, 1);
+		    }
+		  mask = None;
 	       }
 	  }
      }
-/*   
-   sf = MAX(sw, sh);
-#define BMAX 26
-   if      (sf <= 8    ) sf = 1 << (BMAX - 3);
-   else if (sf <= 16   ) sf = 1 << (BMAX - 4);
-   else if (sf <= 32   ) sf = 1 << (BMAX - 5);
-   else if (sf <= 64   ) sf = 1 << (BMAX - 6);
-   else if (sf <= 128  ) sf = 1 << (BMAX - 7);
-   else if (sf <= 256  ) sf = 1 << (BMAX - 8);
-   else if (sf <= 512  ) sf = 1 << (BMAX - 9);
-   else if (sf <= 1024 ) sf = 1 << (BMAX - 10);
-   else if (sf <= 2048 ) sf = 1 << (BMAX - 11);
-   else if (sf <= 4096 ) sf = 1 << (BMAX - 12);
-   else if (sf <= 8192 ) sf = 1 << (BMAX - 13);
-   else if (sf <= 16384) sf = 1 << (BMAX - 14);
-   else                  sf = 1 << (BMAX - 15);
-*/
-   
-//   xf.matrix[0][0] = (sf * sw) / w;
+
    xf.matrix[0][0] = (sw << 16) / w;
    xf.matrix[0][1] = 0;
    xf.matrix[0][2] = 0;
 
    xf.matrix[1][0] = 0;
-//   xf.matrix[1][1] = (sf * sh) / h;
    xf.matrix[1][1] = (sh << 16) / h;
    xf.matrix[1][2] = 0;
 
    xf.matrix[2][0] = 0;
    xf.matrix[2][1] = 0;
    xf.matrix[2][2] = 1 << 16;
-//   xf.matrix[2][2] = sf;
 
    _xr_render_surface_clips_set(drs, dc, x, y, w, h);
    if (trs)
@@ -463,18 +450,45 @@
      }
    else
      {
-	if (smooth)
-	  XRenderSetPictureFilter(srs->xinf->disp, srs->pic, "best", NULL, 0);
-	else 
-	  XRenderSetPictureFilter(srs->xinf->disp, srs->pic, "nearest", NULL, 0);
-	XRenderSetPictureTransform(srs->xinf->disp, srs->pic, &xf);
-	
-	XRenderComposite(srs->xinf->disp, op, srs->pic, mask, drs->pic,
-//			 (sx * w) / sw,
-//			 (sy * h) / sh,
-			 ((sx * w) + (sw / 2)) / sw, 
-			 ((sy * h) + (sh / 2)) / sh,
-			 0, 0, x, y, w, h);
+	if (srs->bordered && e)
+	  {
+	    trs = _xr_render_surface_new(srs->xinf, sw + 1, sh + 1,
+					 srs->fmt, srs->alpha);
+	    if (!trs) return;
+
+	    XRenderSetPictureTransform(srs->xinf->disp, srs->pic, &id);
+	    XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, None,
+			     trs->pic, sx, sy, 0, 0, 0, 0, sw, sh);
+	    XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, None,
+			     trs->pic, sx + sw - 1, sy, 0, 0, sw, 0, 1, sh);
+	    XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, None,
+			     trs->pic, sx, sy + sh - 1, 0, 0, 0, sh, sw, 1);
+	    XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, None,
+			     trs->pic, sx + sw - 1, sy + sh - 1, 0, 0, sw, sh, 1, 1);
+
+	    if (smooth)
+		XRenderSetPictureFilter(trs->xinf->disp, trs->pic, "best", NULL, 0);
+	    else 
+		XRenderSetPictureFilter(trs->xinf->disp, trs->pic, "nearest", NULL, 0);
+
+	    XRenderSetPictureTransform(trs->xinf->disp, trs->pic, &xf);
+	    XRenderComposite(trs->xinf->disp, op, trs->pic, mask, drs->pic,
+			     0, 0, 0, 0, x, y, w, h);
+	    _xr_render_surface_free(trs);
+	  }
+	else
+	  {
+	    if (smooth)
+		XRenderSetPictureFilter(srs->xinf->disp, srs->pic, "best", NULL, 0);
+	    else 
+		XRenderSetPictureFilter(srs->xinf->disp, srs->pic, "nearest", NULL, 0);
+
+	    XRenderSetPictureTransform(srs->xinf->disp, srs->pic, &xf);
+	    XRenderComposite(srs->xinf->disp, op, srs->pic, mask, drs->pic,
+			     ((sx * w) + (sw / 2)) / sw, 
+			     ((sy * h) + (sh / 2)) / sh,
+			     0, 0, x, y, w, h);
+	  }
      }
 }
 
Index: e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine.c,v
retrieving revision 1.4
diff -u -r1.4 evas_engine.c
--- e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine.c	2 May 2006 07:28:49 -0000	1.4
+++ e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine.c	16 May 2006 10:55:44 -0000
@@ -79,6 +79,8 @@
 static void *eng_image_data_put(void *data, void *image, DATA32 *image_data);
 static void *eng_image_alpha_set(void *data, void *image, int has_alpha);
 static int eng_image_alpha_get(void *data, void *image);
+static void *eng_image_border_set(void *data, void *image, int l, int r, int t, int b);
+static void eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b);
 static void eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth);
 static char *eng_image_comment_get(void *data, void *image, char *key);
 static char *eng_image_format_get(void *data, void *image);
@@ -667,6 +669,21 @@
    return _xre_image_alpha_get((XR_Image *)image);
 }
 
+static void *
+eng_image_border_set(void *data, void *image, int l, int r, int t, int b)
+{
+   if (!image) return image;
+   _xre_image_border_set((XR_Image *)image, l, r, t, b);
+   return image;
+}
+
+static void
+eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b)
+{
+   if (!image) return;
+   _xre_image_border_get((XR_Image *)image, l, r, t, b);
+}
+
 static void
 eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
 {
@@ -803,6 +820,8 @@
    ORD(image_data_put);
    ORD(image_alpha_set);
    ORD(image_alpha_get);
+   ORD(image_border_set);
+   ORD(image_border_get);
    ORD(image_draw);
    ORD(image_comment_get);
    ORD(image_format_get);
Index: e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine.h
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine.h,v
retrieving revision 1.3
diff -u -r1.3 evas_engine.h
--- e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine.h	6 May 2006 06:22:57 -0000	1.3
+++ e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine.h	16 May 2006 10:55:45 -0000
@@ -61,6 +61,7 @@
    XCBRenderPICTURE       pic;
    unsigned char          alpha : 1;
    unsigned char          allocated : 1;
+   unsigned char          bordered : 1;
 };
 
 /* ximage support calls (ximage vs xshmimage, cache etc.) */
@@ -123,6 +124,8 @@
 void      _xre_image_data_put(XR_Image *im, void *data);
 void      _xre_image_alpha_set(XR_Image *im, int alpha);
 int       _xre_image_alpha_get(XR_Image *im);
+void      _xre_image_border_set(XR_Image *im, int l, int r, int t, int b);
+void      _xre_image_border_get(XR_Image *im, int *l, int *r, int *t, int *b);
 void      _xre_image_surface_gen(XR_Image *im);
 void      _xre_image_cache_set(int size);
 int       _xre_image_cache_get(void);
Index: e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine_image.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine_image.c,v
retrieving revision 1.4
diff -u -r1.4 evas_engine_image.c
--- e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine_image.c	2 May 2006 07:28:49 -0000	1.4
+++ e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine_image.c	16 May 2006 10:55:47 -0000
@@ -476,6 +476,29 @@
 }
 
 void
+_xre_image_border_set(XR_Image *im, int l, int r, int t, int b)
+{
+   if (!im) return;
+   _xre_image_surface_gen(im);
+   if (l < 1) l = 0;
+   if (r < 1) r = 0;
+   if (t < 1) t = 0;
+   if (b < 1) b = 0;
+   if (im->surface)
+     {
+	if (l | r | t | b)
+	  im->surface->bordered = 1;
+	else
+	  im->surface->bordered = 0;
+    }
+}
+
+void
+_xre_image_border_get(XR_Image *im, int *l, int *r, int *t, int *b)
+{
+}
+
+void
 _xre_image_surface_gen(XR_Image *im)
 {
    void *data = NULL;