Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        eimage.c eimage.h pager.c 


Log Message:
Fix showing tiled external pixmap in pager.

===================================================================
RCS file: /cvs/e/e16/e/src/eimage.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- eimage.c    6 Jan 2008 14:03:42 -0000       1.22
+++ eimage.c    14 Jan 2008 21:49:12 -0000      1.23
@@ -491,6 +491,42 @@
 }
 
 void
+ScaleTile(Win wsrc, Drawable src, Win wdst, Pixmap dst,
+         int dx, int dy, int dw, int dh, int scale)
+{
+   Imlib_Image         im, tim;
+   int                 sw, sh, stw, sth, tw, th;
+
+   sw = WinGetW(wsrc);
+   sh = WinGetH(wsrc);
+   EXGetGeometry(src, NULL, NULL, NULL, &stw, &sth, NULL, NULL);
+   if (stw >= sw && sth >= sh)
+     {
+       ScaleRect(wsrc, src, wdst, dst, 0, 0, sw, sh, dx, dy, dw, dh, scale);
+       return;
+     }
+
+   /* Source Drawawble is smaller than source window - do scaled tiling */
+
+   scale = (scale) ? 2 : 1;
+
+   tw = (int)((double)(stw * scale * dw) / sw + .5);
+   th = (int)((double)(sth * scale * dh) / sh + .5);
+#if 0
+   Eprintf("ScaleTile: Tile %#lx %dx%d -> %dx%d T %dx%d -> %dx%d\n", src,
+          stw, sth, tw, th, scale * dw, scale * dh, dw, dh);
+#endif
+   tim =
+      EImageGrabDrawableScaled(wsrc, src, None, 0, 0, stw, sth, tw, th, 0, 0);
+   im = EImageCreate(scale * dw, scale * dh);
+   EImageTile(im, tim, 0, tw, th, 0, 0, scale * dw, scale * dh, 0, 0);
+   EImageFree(tim);
+
+   EImageRenderOnDrawable(im, wdst, dst, EIMAGE_ANTI_ALIAS, dx, dy, dw, dh);
+   imlib_free_image();
+}
+
+void
 EDrawableDumpImage(Drawable draw, const char *txt)
 {
    static int          seqn = 0;
===================================================================
RCS file: /cvs/e/e16/e/src/eimage.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- eimage.h    30 Dec 2007 21:18:04 -0000      1.14
+++ eimage.h    14 Jan 2008 21:49:12 -0000      1.15
@@ -105,6 +105,8 @@
 void                ScaleRect(Win wsrc, Drawable src, Win wdst, Pixmap dst,
                              int sx, int sy, int sw, int sh,
                              int dx, int dy, int dw, int dh, int scale);
+void                ScaleTile(Win wsrc, Drawable src, Win wdst, Pixmap dst,
+                             int dx, int dy, int dw, int dh, int scale);
 
 void                EDrawableDumpImage(Drawable draw, const char *txt);
 
===================================================================
RCS file: /cvs/e/e16/e/src/pager.c,v
retrieving revision 1.252
retrieving revision 1.253
diff -u -3 -r1.252 -r1.253
--- pager.c     30 Dec 2007 21:18:04 -0000      1.252
+++ pager.c     14 Jan 2008 21:49:12 -0000      1.253
@@ -611,8 +611,8 @@
 
    if (pager_mode != PAGER_MODE_SIMPLE && p->dsk->bg.pmap)
      {
-       ScaleRect(VRoot.win, p->dsk->bg.pmap, p->win, pmap, 0, 0,
-                 VRoot.w, VRoot.h, 0, 0, p->dw, p->dh, Conf_pagers.hiq);
+       ScaleTile(VRoot.win, p->dsk->bg.pmap, p->win, pmap,
+                 0, 0, p->dw, p->dh, Conf_pagers.hiq);
        return;
      }
 



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to