Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
backgrounds.c container.c dialog.c eimage.c eimage.h
extinitwin.c fx.c hiwin.c iclass.c pager.c text.c tooltips.c
warp.c
Log Message:
Use anti-alias only when appropriate.
===================================================================
RCS file: /cvs/e/e16/e/src/backgrounds.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -3 -r1.91 -r1.92
--- backgrounds.c 25 Feb 2007 18:05:52 -0000 1.91
+++ backgrounds.c 6 Apr 2007 22:20:07 -0000 1.92
@@ -657,7 +657,7 @@
{
/* Window, no fg, no offset, and scale to 100%, or tiled, no trans */
pmap = BackgroundCreatePixmap(win, w, h);
- EImageRenderOnDrawable(bg->bg.im, win, pmap, 0, 0, w, h, 0);
+ EImageRenderOnDrawable(bg->bg.im, win, pmap, 0, 0, 0, w, h);
#if 0 /* FIXME - Remove? */
if (x == 0 && y == 0) /* Hmmm. Always true. */
@@ -723,7 +723,7 @@
EImageBlend(im, bg->top.im, 1, 0, 0, ww, hh, x, y, w, h, 0, 0);
}
- EImageRenderOnDrawable(im, win, pmap, 0, 0, rw, rh, 0);
+ EImageRenderOnDrawable(im, win, pmap, 0, 0, 0, rw, rh);
if (im != bg->bg.im)
EImageFree(im);
@@ -1836,7 +1836,7 @@
im = BackgroundCacheMini(bg, 1, 0);
if (im)
{
- EImageRenderOnDrawable(im, win, pmap, x + 4, 4, 64, 48, 0);
+ EImageRenderOnDrawable(im, win, pmap, 0, x + 4, 4, 64, 48);
EImageFree(im);
}
}
===================================================================
RCS file: /cvs/e/e16/e/src/container.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- container.c 6 Apr 2007 21:44:22 -0000 1.8
+++ container.c 6 Apr 2007 22:20:07 -0000 1.9
@@ -1166,7 +1166,7 @@
if (im)
{
EMapWindow(ct->icon_win);
- EImageRenderPixmaps(im, ct->icon_win, &pmap, &mask, 0, 0);
+ EImageRenderPixmaps(im, ct->icon_win, 0, &pmap, &mask, 0, 0);
ESetWindowBackgroundPixmap(ct->icon_win, pmap);
EShapeCombineMask(ct->icon_win, ShapeBounding, 0, 0, mask, ShapeSet);
EImagePixmapFree(pmap);
===================================================================
RCS file: /cvs/e/e16/e/src/dialog.c,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -3 -r1.182 -r1.183
--- dialog.c 6 Apr 2007 21:44:22 -0000 1.182
+++ dialog.c 6 Apr 2007 22:20:07 -0000 1.183
@@ -446,7 +446,8 @@
db->w - (h + 2 + pad->left + pad->right),
h, h, TextclassGetJustification(db->tclass));
- EImageRenderOnDrawable(im, db->win, None, pad->left, pad->top, h, h, 1);
+ EImageRenderOnDrawable(im, db->win, None, EIMAGE_BLEND,
+ pad->left, pad->top, h, h);
EImageFree(im);
}
else
@@ -1222,7 +1223,7 @@
EImageGetSize(im, &iw, &ih);
di->win = ECreateWindow(d->win, 0, 0, iw, ih, 0);
EMapWindow(di->win);
- EImageRenderPixmaps(im, di->win, &pmap, &mask, 0, 0);
+ EImageRenderPixmaps(im, di->win, 0, &pmap, &mask, 0, 0);
ESetWindowBackgroundPixmap(di->win, pmap);
EShapeCombineMask(di->win, ShapeBounding, 0, 0, mask, ShapeSet);
EClearWindow(di->win);
===================================================================
RCS file: /cvs/e/e16/e/src/eimage.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- eimage.c 17 Jan 2007 01:10:42 -0000 1.13
+++ eimage.c 6 Apr 2007 22:20:07 -0000 1.14
@@ -49,6 +49,7 @@
imlib_context_set_mask_alpha_threshold(Conf.testing.mask_alpha_threshold);
#endif
+ imlib_context_set_anti_alias(0);
imlib_context_set_dither(1);
}
@@ -363,9 +364,23 @@
return im;
}
+static void
+_EImageFlagsSet(int flags)
+{
+ imlib_context_set_anti_alias((flags & EIMAGE_ANTI_ALIAS) ? 1 : 0);
+ imlib_context_set_blend((flags & EIMAGE_BLEND) ? 1 : 0);
+}
+
+static void
+_EImageFlagsReset(void)
+{
+ imlib_context_set_anti_alias(0);
+ imlib_context_set_blend(0);
+}
+
void
-EImageRenderOnDrawable(EImage * im, Win win, Drawable draw, int x, int y,
- int w, int h, int blend)
+EImageRenderOnDrawable(EImage * im, Win win, Drawable draw, int flags,
+ int x, int y, int w, int h)
{
Visual *vis;
@@ -375,19 +390,19 @@
if (vis)
imlib_context_set_visual(vis);
- if (blend)
- imlib_context_set_blend(1);
+ if (flags)
+ _EImageFlagsSet(flags);
imlib_render_image_on_drawable_at_size(x, y, w, h);
- if (blend)
- imlib_context_set_blend(0);
+ if (flags)
+ _EImageFlagsReset();
if (vis)
imlib_context_set_visual(_default_vis);
}
void
-EImageRenderPixmaps(EImage * im, Win win, Pixmap * pmap, Pixmap * mask,
- int w, int h)
+EImageRenderPixmaps(EImage * im, Win win, int flags,
+ Pixmap * pmap, Pixmap * mask, int w, int h)
{
Visual *vis;
Pixmap m;
@@ -404,10 +419,14 @@
if (mask)
*mask = None;
+ if (flags)
+ _EImageFlagsSet(flags);
if (w <= 0 || h <= 0)
imlib_render_pixmaps_for_whole_image(pmap, mask);
else
imlib_render_pixmaps_for_whole_image_at_size(pmap, mask, w, h);
+ if (flags)
+ _EImageFlagsReset();
if (vis)
imlib_context_set_visual(_default_vis);
@@ -430,14 +449,14 @@
im = EImageGrabDrawableScaled(wsrc, src, None, sx, sy, sw, sh,
scale * dw, scale * dh, 0, 0);
- imlib_context_set_anti_alias(1);
if (pdst)
{
- EImageRenderPixmaps(im, wdst, pdst, None, dw, dh);
+ EImageRenderPixmaps(im, wdst, EIMAGE_ANTI_ALIAS, pdst, None, dw, dh);
}
else
{
- EImageRenderOnDrawable(im, wdst, dst, dx, dy, dw, dh, 0);
+ EImageRenderOnDrawable(im, wdst, dst, EIMAGE_ANTI_ALIAS,
+ dx, dy, dw, dh);
}
imlib_free_image();
}
===================================================================
RCS file: /cvs/e/e16/e/src/eimage.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- eimage.h 13 Jan 2007 19:14:27 -0000 1.7
+++ eimage.h 6 Apr 2007 22:20:07 -0000 1.8
@@ -34,6 +34,9 @@
int left, right, top, bottom;
} EImageBorder;
+#define EIMAGE_BLEND 0x01
+#define EIMAGE_ANTI_ALIAS 0x02
+
void EImageInit(Display * dpy);
EImage *EImageCreate(int w, int h);
@@ -79,10 +82,10 @@
int get_mask_from_shape);
void EImageRenderOnDrawable(EImage * im, Win win, Drawable draw,
- int x, int y, int w, int h,
- int blend);
+ int flags,
+ int x, int y, int w, int h);
-void EImageRenderPixmaps(EImage * im, Win win,
+void EImageRenderPixmaps(EImage * im, Win win, int flags,
Pixmap * pmap, Pixmap * mask,
int w, int h);
void EImagePixmapFree(Pixmap pmap);
===================================================================
RCS file: /cvs/e/e16/e/src/extinitwin.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- extinitwin.c 13 Jan 2007 19:14:27 -0000 1.20
+++ extinitwin.c 6 Apr 2007 22:20:07 -0000 1.21
@@ -118,7 +118,7 @@
im = ThemeImageLoad(s);
if (im)
{
- EImageRenderPixmaps(im, NULL, &pmap, &mask, 0, 0);
+ EImageRenderPixmaps(im, NULL, 0, &pmap, &mask, 0, 0);
EImageGetSize(im, &w, &h);
XShapeCombineMask(disp, w2, ShapeBounding, 0, 0, mask,
ShapeSet);
===================================================================
RCS file: /cvs/e/e16/e/src/fx.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -3 -r1.79 -r1.80
--- fx.c 25 Feb 2007 19:03:19 -0000 1.79
+++ fx.c 6 Apr 2007 22:20:07 -0000 1.80
@@ -643,7 +643,7 @@
sscanf(fx_imagespinner_params, "%*s %i %i ", &x, &y);
x = ((VRoot.w * x) >> 10) - ((w * x) >> 10);
y = ((VRoot.h * y) >> 10) - ((h * y) >> 10);
- EImageRenderOnDrawable(im, fx_imagespinner_win, x, y, w, h, 0);
+ EImageRenderOnDrawable(im, fx_imagespinner_win, 0, x, y, w, h);
EImageFree(im);
}
Efree(string);
===================================================================
RCS file: /cvs/e/e16/e/src/hiwin.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- hiwin.c 17 Jan 2007 01:10:43 -0000 1.24
+++ hiwin.c 6 Apr 2007 22:20:07 -0000 1.25
@@ -109,12 +109,12 @@
HiwinRenderImageDrawX(Hiwin * phi, Drawable draw __UNUSED__)
{
#if 0
- EImageRenderOnDrawable(phi->im, EoGetWin(phi), draw, 0, 0,
- EoGetW(phi), EoGetH(phi), 0);
+ EImageRenderOnDrawable(phi->im, EoGetWin(phi), draw, 0,
+ 0, 0, EoGetW(phi), EoGetH(phi));
#else
Pixmap pmap, mask;
- EImageRenderPixmaps(phi->im, EoGetWin(phi), &pmap, &mask,
+ EImageRenderPixmaps(phi->im, EoGetWin(phi), EIMAGE_ANTI_ALIAS, &pmap, &mask,
EoGetW(phi), EoGetH(phi));
ESetWindowBackgroundPixmap(EoGetWin(phi), pmap);
if (mask)
===================================================================
RCS file: /cvs/e/e16/e/src/iclass.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -3 -r1.115 -r1.116
--- iclass.c 25 Feb 2007 18:05:52 -0000 1.115
+++ iclass.c 6 Apr 2007 22:20:07 -0000 1.116
@@ -844,7 +844,7 @@
x = y = 0;
}
- EImageRenderOnDrawable(im, win, draw, x, y, w, h, 0);
+ EImageRenderOnDrawable(im, win, draw, 0, x, y, w, h);
EImageFree(im);
return pmap;
@@ -1014,14 +1014,15 @@
pmm->mask = None;
pmm->w = w;
pmm->h = h;
- EImageRenderOnDrawable(ii, win, pmap, 0, 0, w, h, 0);
+ EImageRenderOnDrawable(ii, win, pmap, 0, 0, 0, w, h);
if (make_mask && !(flags & ICLASS_ATTR_NO_CLIP))
{
if (EImageHasAlpha(is->im))
{
/* Make the scaled clip mask to be used */
- EImageRenderPixmaps(is->im, win, &pmap, &mask, w, h);
+ EImageRenderPixmaps(is->im, win, EIMAGE_ANTI_ALIAS, &pmap,
+ &mask, w, h);
/* Replace the mask with the correct one */
pmm->mask = EXCreatePixmapCopy(mask, w, h, 1);
@@ -1042,7 +1043,8 @@
pmm->pmap = pmm->mask = None;
pmm->w = w;
pmm->h = h;
- EImageRenderPixmaps(is->im, win, &pmm->pmap, &pmm->mask, w, h);
+ EImageRenderPixmaps(is->im, win, EIMAGE_ANTI_ALIAS, &pmm->pmap,
+ &pmm->mask, w, h);
}
else
{
@@ -1078,7 +1080,8 @@
pmm->pmap = pmm->mask = None;
pmm->w = pw;
pmm->h = ph;
- EImageRenderPixmaps(is->im, win, &pmm->pmap, &pmm->mask, pw, ph);
+ EImageRenderPixmaps(is->im, win, EIMAGE_ANTI_ALIAS, &pmm->pmap,
+ &pmm->mask, pw, ph);
}
}
===================================================================
RCS file: /cvs/e/e16/e/src/pager.c,v
retrieving revision 1.238
retrieving revision 1.239
diff -u -3 -r1.238 -r1.239
--- pager.c 6 Apr 2007 21:44:22 -0000 1.238
+++ pager.c 6 Apr 2007 22:20:07 -0000 1.239
@@ -281,7 +281,7 @@
im = EImageGrabDrawable(ewin->mini_pmm.pmap, None, 0, 0,
ewin->mini_w, ewin->mini_h, 0);
- EImageRenderOnDrawable(im, EoGetWin(phi), 0, 0, EoGetW(phi), EoGetH(phi),
0);
+ EImageRenderOnDrawable(im, EoGetWin(phi), 0, 0, 0, EoGetW(phi),
EoGetH(phi));
EImageDecache(im);
}
#endif
@@ -597,7 +597,7 @@
im = EImageLoad(s);
if (im)
{
- EImageRenderOnDrawable(im, p->win, pmap, 0, 0, p->dw, p->dh, 0);
+ EImageRenderOnDrawable(im, p->win, pmap, 0, 0, 0, p->dw, p->dh);
EImageDecache(im);
}
else
===================================================================
RCS file: /cvs/e/e16/e/src/text.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -3 -r1.85 -r1.86
--- text.c 17 Jan 2007 01:10:43 -0000 1.85
+++ text.c 6 Apr 2007 22:20:07 -0000 1.86
@@ -68,20 +68,20 @@
case FONT_TO_UP:
im = EImageGrabDrawable(src, 0, y, x, h, w, 0);
EImageOrientate(im, 1);
- EImageRenderOnDrawable(im, win, dst, 0, 0, w, h, 0);
+ EImageRenderOnDrawable(im, win, dst, 0, 0, 0, w, h);
EImageFree(im);
break;
case FONT_TO_DOWN:
EXGetGeometry(src, NULL, NULL, NULL, &win_w, NULL, NULL, NULL);
im = EImageGrabDrawable(src, None, win_w - y - h, x, h, w, 0);
EImageOrientate(im, 3);
- EImageRenderOnDrawable(im, win, dst, 0, 0, w, h, 0);
+ EImageRenderOnDrawable(im, win, dst, 0, 0, 0, w, h);
EImageFree(im);
break;
case FONT_TO_LEFT: /* Holy carumba! That's for yoga addicts, maybe
.... */
im = EImageGrabDrawable(src, None, x, y, w, h, 0);
EImageOrientate(im, 2);
- EImageRenderOnDrawable(im, win, dst, 0, 0, w, h, 0);
+ EImageRenderOnDrawable(im, win, dst, 0, 0, 0, w, h);
EImageFree(im);
break;
default:
@@ -101,20 +101,20 @@
case FONT_TO_UP:
im = EImageGrabDrawable(src, None, 0, 0, w, h, 0);
EImageOrientate(im, 3);
- EImageRenderOnDrawable(im, win, dst, y, x, h, w, 0);
+ EImageRenderOnDrawable(im, win, dst, 0, y, x, h, w);
EImageFree(im);
break;
case FONT_TO_DOWN:
EXGetGeometry(dst, NULL, NULL, NULL, &win_w, NULL, NULL, NULL);
- im = EImageGrabDrawable(src, None, 0, 0, w, h, 0);
+ im = EImageGrabDrawable(src, None, 0, 0, 0, w, h);
EImageOrientate(im, 1);
- EImageRenderOnDrawable(im, win, dst, win_w - y - h, x, h, w, 0);
+ EImageRenderOnDrawable(im, win, dst, 0, win_w - y - h, x, h, w);
EImageFree(im);
break;
case FONT_TO_LEFT: /* Holy carumba! That's for yoga addicts, maybe
.... */
im = EImageGrabDrawable(src, None, 0, 0, w, h, 0);
EImageOrientate(im, 2);
- EImageRenderOnDrawable(im, win, dst, x, y, w, h, 0);
+ EImageRenderOnDrawable(im, win, dst, 0, x, y, w, h);
EImageFree(im);
break;
default:
@@ -164,20 +164,20 @@
{
default:
case FONT_TO_RIGHT:
- EImageRenderOnDrawable(im, win, dst, x, y, w, h, 0);
+ EImageRenderOnDrawable(im, win, dst, 0, x, y, w, h);
break;
case FONT_TO_LEFT:
EImageOrientate(im, 2);
- EImageRenderOnDrawable(im, win, dst, x, y, w, h, 0);
+ EImageRenderOnDrawable(im, win, dst, 0, x, y, w, h);
break;
case FONT_TO_UP:
EImageOrientate(im, 3);
- EImageRenderOnDrawable(im, win, dst, y, x, h, w, 0);
+ EImageRenderOnDrawable(im, win, dst, 0, y, x, h, w);
break;
case FONT_TO_DOWN:
EXGetGeometry(dst, NULL, NULL, NULL, &win_w, NULL, NULL, NULL);
EImageOrientate(im, 1);
- EImageRenderOnDrawable(im, win, dst, win_w - y - h, x, h, w, 0);
+ EImageRenderOnDrawable(im, win, dst, 0, win_w - y - h, x, h, w);
break;
}
EImageFree(im);
===================================================================
RCS file: /cvs/e/e16/e/src/tooltips.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -3 -r1.113 -r1.114
--- tooltips.c 17 Jan 2007 01:10:43 -0000 1.113
+++ tooltips.c 6 Apr 2007 22:20:07 -0000 1.114
@@ -276,7 +276,7 @@
return;
EImageGetSize(im, &w, &h);
- EImageRenderOnDrawable(im, tt->TTWIN->win, None, x, y, w, h, 1);
+ EImageRenderOnDrawable(im, tt->TTWIN->win, None, EIMAGE_BLEND, x, y, w, h);
*px = x + w;
}
===================================================================
RCS file: /cvs/e/e16/e/src/warp.c,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -3 -r1.104 -r1.105
--- warp.c 6 Mar 2007 03:33:31 -0000 1.104
+++ warp.c 6 Apr 2007 22:20:07 -0000 1.105
@@ -236,9 +236,9 @@
Conf.warplist.icon_mode);
if (im)
{
- EImageRenderOnDrawable(im, wi->win, None,
+ EImageRenderOnDrawable(im, wi->win, None, EIMAGE_BLEND,
pad->left + ICON_PAD, ICON_PAD,
- icon_size, icon_size, 1);
+ icon_size, icon_size);
EImageFree(im);
}
iw = fw->mh;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs