Enlightenment CVS committal
Author : doursse
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/modules/engines/xrender_xcb
Modified Files:
Makefile.am evas_engine.c evas_engine_image.c
evas_engine_xrender.c
Log Message:
fix a leak in xcb eng sfw (it remains one, but I don't see where it comes
from). Update the xrender one. Don't use them yet (but who uses them ??),
because it relies on fix of xcb that are in my hd
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- Makefile.am 11 Mar 2006 01:55:17 -0000 1.2
+++ Makefile.am 23 Apr 2006 15:38:23 -0000 1.3
@@ -2,7 +2,7 @@
MAINTAINERCLEANFILES = Makefile.in
-INCLUDES = -I. -I$(top_srcdir)/src/lib -I$(top_srcdir)/src/lib/include
-I$(top_srcdir)/src/modules/engines @FREETYPE_CFLAGS@ @xcb_cflags@
+INCLUDES = -I. -I$(top_srcdir)/src/lib -I$(top_srcdir)/src/lib/include
-I$(top_srcdir)/src/modules/engines @FREETYPE_CFLAGS@ @xcbrender_cflags@
if BUILD_ENGINE_XRENDER_XCB
@@ -18,7 +18,7 @@
evas_engine_font.c \
evas_engine_gradient.c
-module_la_LIBADD = @xcb_libs@ $(top_builddir)/src/lib/libevas.la
+module_la_LIBADD = @xcbrender_libs@ $(top_builddir)/src/lib/libevas.la
module_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/src/lib
-L$(top_builddir)/src/lib/.libs
module_la_DEPENDENCIES = $(top_builddir)/config.h
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_engine.c 16 Mar 2006 08:16:16 -0000 1.2
+++ evas_engine.c 23 Apr 2006 15:38:23 -0000 1.3
@@ -113,6 +113,7 @@
{
Render_Engine *re;
Evas_Engine_Info_XRender_Xcb *info;
+ int resize = 1;
info = (Evas_Engine_Info_XRender_Xcb *)in;
if (!e->engine.data.output)
@@ -134,6 +135,7 @@
if (re->tb)
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
e->engine.data.output = re;
+ resize = 0;
}
re = e->engine.data.output;
if (!re) return;
@@ -150,19 +152,31 @@
re->xcbinf = _xr_image_info_get(re->conn, re->win, re->vis);
if (re->output) _xr_render_surface_free(re->output);
- re->output = _xr_render_surface_adopt(re->xcbinf, re->win, e->output.w,
e->output.h, 0);
- if (re->mask.xid)
- {
- XCBDRAWABLE draw;
-
- if (re->mask_output) _xr_render_surface_free(re->mask_output);
- draw.pixmap = re->mask;
- re->mask_output = _xr_render_surface_format_adopt(re->xcbinf, draw,
- e->output.w,
e->output.h,
- re->xcbinf->fmt1, 1);
- }
+ if (re->mask_output) _xr_render_surface_free(re->mask_output);
+ if (!re->mask.xid)
+ re->output = _xr_render_surface_adopt(re->xcbinf, re->win, e->output.w,
e->output.h, re->destination_alpha);
+ else
+ re->output = _xr_render_surface_adopt(re->xcbinf, re->win, e->output.w,
e->output.h, 0);
+ if (re->mask.xid) {
+ XCBDRAWABLE draw;
+
+ draw.pixmap = re->mask;
+ re->mask_output = _xr_render_surface_format_adopt(re->xcbinf, draw,
+ e->output.w, e->output.h,
+ re->xcbinf->fmt1, 1);
+ }
else
re->mask_output = NULL;
+ if (resize)
+ {
+ if (re->tb) evas_common_tilebuf_free(re->tb);
+ if ((e->output.w > 0) && (e->output.h > 0))
+ re->tb = evas_common_tilebuf_new(e->output.w, e->output.h);
+ else
+ re->tb = evas_common_tilebuf_new(1, 1);
+ if (re->tb)
+ evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
+ }
}
static void
===================================================================
RCS file:
/cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine_image.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_engine_image.c 15 Mar 2006 21:14:34 -0000 1.2
+++ evas_engine_image.c 23 Apr 2006 15:38:23 -0000 1.3
@@ -279,7 +279,8 @@
ww = w; hh = h;
RECTS_CLIP_TO_RECT(x, y, ww, hh, 0, 0, im->w, im->h);
old_surface = im->surface;
- im->surface = _xr_render_surface_new(old_surface->xcbinf, w, h,
old_surface->fmt, old_surface->alpha);
+ im->surface = _xr_render_surface_new(old_surface->xcbinf,
+ w + 1, h + 1, old_surface->fmt,
old_surface->alpha);
if (im->surface)
_xr_render_surface_copy(old_surface, im->surface, 0, 0, 0, 0, ww, hh);
_xr_render_surface_free(old_surface);
@@ -451,11 +452,14 @@
old_surface = im->surface;
im->surface = NULL;
if (im->alpha)
- im->surface = _xr_render_surface_new(im->xcbinf, im->w, im->h,
im->xcbinf->fmt32, 1);
+ im->surface = _xr_render_surface_new(im->xcbinf,
+ im->w + 1, im->h + 1,
im->xcbinf->fmt32, 1);
else
- im->surface = _xr_render_surface_new(im->xcbinf, im->w, im->h,
im->xcbinf->fmt24, 0);
+ im->surface = _xr_render_surface_new(im->xcbinf,
+ im->w + 1, im->h + 1,
im->xcbinf->fmt24, 0);
if (im->surface)
- _xr_render_surface_copy(old_surface, im->surface, 0, 0, 0, 0, im->w,
im->h);
+ _xr_render_surface_copy(old_surface,
+ im->surface, 0, 0, 0, 0, im->w + 1, im->h +
1);
_xr_render_surface_free(old_surface);
}
if (im->updates)
@@ -517,14 +521,29 @@
}
if (im->alpha)
{
- im->surface = _xr_render_surface_new(im->xcbinf, im->w, im->h,
im->xcbinf->fmt32, 1);
+ im->surface = _xr_render_surface_new(im->xcbinf,
+ im->w + 1, im->h + 1,
im->xcbinf->fmt32, 1);
_xr_render_surface_argb_pixels_fill(im->surface, im->w, im->h, data, 0,
0, im->w, im->h);
}
else
{
- im->surface = _xr_render_surface_new(im->xcbinf, im->w, im->h,
im->xcbinf->fmt24, 0);
+ im->surface = _xr_render_surface_new(im->xcbinf,
+ im->w + 1, im->h + 1,
im->xcbinf->fmt24, 0);
_xr_render_surface_rgb_pixels_fill(im->surface, im->w, im->h, data, 0,
0, im->w, im->h);
- }
+ }
+ /* fill right and bottom pixel so interpolation works right */
+ _xr_render_surface_copy(im->surface, im->surface,
+ im->w - 1, 0,
+ im->w, 0,
+ 1, im->h);
+ _xr_render_surface_copy(im->surface, im->surface,
+ 0, im->h - 1,
+ 0, im->h,
+ im->w, 1);
+ _xr_render_surface_copy(im->surface, im->surface,
+ im->w - 1, im->h - 1,
+ im->w, im->h,
+ 1, 1);
if ((im->im) && (!im->dirty))
{
evas_common_image_unref(im->im);
===================================================================
RCS file:
/cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine_xrender.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- evas_engine_xrender.c 10 Mar 2006 19:10:07 -0000 1.1
+++ evas_engine_xrender.c 23 Apr 2006 15:38:23 -0000 1.2
@@ -93,9 +93,9 @@
CARD32 mask;
CARD32 values[3];
- rs = calloc(1, sizeof(XCBrender_Surface));
-
fmt = XCBRenderFindVisualFormat(xcbinf->conn, xcbinf->vis);
+ if (!fmt) return NULL;
+ rs = calloc(1, sizeof(XCBrender_Surface));
rs->xcbinf = xcbinf;
rs->w = w;
rs->h = h;
@@ -386,6 +386,7 @@
void
_xr_render_surface_composite(XCBrender_Surface *srs, XCBrender_Surface *drs,
RGBA_Draw_Context *dc, int sx, int sy, int sw, int sh, int x, int y, int w, int
h, int smooth)
{
+ XCBrender_Surface *trs = NULL;
XCBRenderTRANSFORM xf;
XCBRenderPICTURE mask;
CARD32 value_mask;
@@ -395,6 +396,65 @@
int op;
if ((sw <= 0) || (sh <= 0) || (w <= 0) || (h <= 0)) return;
+ value_mask = XCBRenderCPClipMask;
+ value_list[0] = 0;
+ XCBRenderChangePicture(srs->xcbinf->conn, srs->pic, value_mask, value_list);
+ XCBRenderChangePicture(srs->xcbinf->conn, drs->pic, value_mask, value_list);
+
+ op = XCBRenderPictOpSrc;
+ if (srs->alpha) op = XCBRenderPictOpOver;
+ mask.xid = 0;
+ if ((dc) && (dc->mul.use))
+ {
+ r = (int)(R_VAL(&dc->mul.col));
+ g = (int)(G_VAL(&dc->mul.col));
+ b = (int)(B_VAL(&dc->mul.col));
+ a = (int)(A_VAL(&dc->mul.col));
+ if ((r != 0xff) || (g != 0xff) || (b != 0xff) || (a != 0xff))
+ {
+ if ((srs->xcbinf->mul_r != r) || (srs->xcbinf->mul_g != g) ||
+ (srs->xcbinf->mul_b != b) || (srs->xcbinf->mul_a != a))
+ {
+ srs->xcbinf->mul_r = r;
+ srs->xcbinf->mul_g = g;
+ srs->xcbinf->mul_b = b;
+ srs->xcbinf->mul_a = a;
+ _xr_render_surface_solid_rectangle_set(srs->xcbinf->mul,
+ r,
+ g,
+ b,
+ a,
+ 0, 0, 1, 1);
+ }
+ op = XCBRenderPictOpOver;
+ value_mask = XCBRenderCPComponentAlpha;
+ value_list[0] = 1;
+ XCBRenderChangePicture(srs->xcbinf->conn, mask, value_mask,
value_list);
+ if ((r == 0xff) && (g == 0xff) && (b == 0xff) && (a != 0xff))
+ {
+ }
+ else
+ {
+ xf.matrix11 = 1;
+ xf.matrix12 = 0;
+ xf.matrix13 = 0;
+
+ xf.matrix21 = 0;
+ xf.matrix22 = 1;
+ xf.matrix23 = 0;
+
+ xf.matrix31 = 0;
+ xf.matrix32 = 0;
+ xf.matrix33 = 1;
+ trs = _xr_render_surface_new(srs->xcbinf, sw, sh, srs->fmt,
srs->alpha);
+ XCBRenderSetPictureTransform(srs->xcbinf->conn, srs->pic, xf);
+ XCBRenderComposite(srs->xcbinf->conn, XCBRenderPictOpSrc,
srs->pic, mask, trs->pic,
+ sx, sy, 0, 0, 0, 0, sw, sh);
+ mask.xid = 0;
+ }
+ }
+ }
+
sf = MAX(sw, sh);
#define BMAX 26
@@ -424,45 +484,32 @@
xf.matrix32 = 0;
xf.matrix33 = sf;
- op = XCBRenderPictOpSrc;
- if (srs->alpha) op = XCBRenderPictOpOver;
- mask.xid = 0;
- if ((dc) && (dc->mul.use))
+ _xr_render_surface_clips_set(drs, dc, x, y, w, h);
+ if (trs)
{
- r = (int)(R_VAL(&dc->mul.col));
- g = (int)(G_VAL(&dc->mul.col));
- b = (int)(B_VAL(&dc->mul.col));
- a = (int)(A_VAL(&dc->mul.col));
- if ((r != 0xff) || (g != 0xff) || (b != 0xff) || (a != 0xff))
- {
- if ((srs->xcbinf->mul_r != r) || (srs->xcbinf->mul_g != g) ||
- (srs->xcbinf->mul_b != b) || (srs->xcbinf->mul_a != a))
- {
- srs->xcbinf->mul_r = r;
- srs->xcbinf->mul_g = g;
- srs->xcbinf->mul_b = b;
- srs->xcbinf->mul_a = a;
- _xr_render_surface_solid_rectangle_set(srs->xcbinf->mul, r,
g, b, a, 0, 0, 1, 1);
- }
- op = XCBRenderPictOpOver;
- mask = srs->xcbinf->mul->pic;
- }
+ if (smooth)
+ XCBRenderSetPictureFilter (trs->xcbinf->conn, trs->pic, strlen
("best"), "best", 0, NULL);
+ else
+ XCBRenderSetPictureFilter (trs->xcbinf->conn, trs->pic, strlen
("nearest"), "nearest", 0, NULL);
+ XCBRenderSetPictureTransform(trs->xcbinf->conn, trs->pic, xf);
+
+ XCBRenderComposite(srs->xcbinf->conn, op, trs->pic, mask, drs->pic,
+ 0, 0, 0, 0, x, y, w, h);
+ _xr_render_surface_free(trs);
}
-
- XCBRenderSetPictureTransform(srs->xcbinf->conn, srs->pic, xf);
- value_mask = XCBRenderCPClipMask;
- value_list[0] = 0;
- XCBRenderChangePicture(srs->xcbinf->conn, srs->pic, value_mask, value_list);
- XCBRenderChangePicture(srs->xcbinf->conn, drs->pic, value_mask, value_list);
-
- if (smooth) XCBRenderSetPictureFilter(srs->xcbinf->conn, srs->pic,
strlen("best"), "best", 0, NULL);
- else XCBRenderSetPictureFilter(srs->xcbinf->conn, srs->pic,
strlen("nearest"), "nearest", 0, NULL);
-
- _xr_render_surface_clips_set(drs, dc, x, y, w, h);
- XCBRenderComposite(srs->xcbinf->conn, op, srs->pic, mask, drs->pic,
- ((sx * w) + (sw / 2)) / sw,
- ((sy * h) + (sh / 2)) / sh,
- 0, 0, x, y, w, h);
+ else
+ {
+ if (smooth)
+ XCBRenderSetPictureFilter (srs->xcbinf->conn, srs->pic, strlen
("best"), "best", 0, NULL);
+ else
+ XCBRenderSetPictureFilter (srs->xcbinf->conn, srs->pic, strlen
("nearest"), "nearest", 0, NULL);
+ XCBRenderSetPictureTransform(srs->xcbinf->conn, srs->pic, xf);
+
+ XCBRenderComposite(srs->xcbinf->conn, op, srs->pic, mask, drs->pic,
+ ((sx * w) + (sw / 2)) / sw,
+ ((sy * h) + (sh / 2)) / sh,
+ 0, 0, x, y, w, h);
+ }
}
void
@@ -473,7 +520,7 @@
CARD32 value_mask;
CARD32 value_list[1];
- if ((w <= 0) || (h <= 0)) return;
+ if ((w <= 0) || (h <= 0) || (!srs) || (!drs)) return;
xf.matrix11 = 1;
xf.matrix12 = 0;
xf.matrix13 = 0;
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs