-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: 386f2c532af6747e653b8262d9e429ccf8641b22:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit 386f2c532af6747e653b8262d9e429ccf8641b22
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Tue Jan 11 11:12:45 2011 +0000

    Reuse existing pixmap if possible in make_transparency_pixmap.

diff --git a/src/background.C b/src/background.C

index 78691d690b63b0ed3c4d64cb60203ef2ada6420b..

index ..f082ca574881f6b0cf17dc91676ad772779839cf 100644

--- a/src/background.C
+++ b/src/background.C
@@ -1327,9 +1327,18 @@ bgPixmap_t::make_transparency_pixmap ()
   if (root_pixmap == None)
     return 0;

-  Pixmap tiled_root_pmap = XCreatePixmap (dpy, target->vt, window_width, window_height, target->depth);
+  if (pixmap == None
+      || pmap_width != window_width
+      || pmap_height != window_height)
+    {
+      if (pixmap)
+        XFreePixmap (target->dpy, pixmap);
+      pixmap = XCreatePixmap (target->dpy, target->vt, window_width, window_height, target->depth);
+      pmap_width = window_width;
+      pmap_height = window_height;
+    }

-  if (tiled_root_pmap == None) /* something really bad happened - abort */
+  if (pixmap == None)
     return 0;

   /* straightforward pixmap copy */
@@ -1344,7 +1353,7 @@ bgPixmap_t::make_transparency_pixmap ()

   if (gc)
     {
-      XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height);
+      XFillRectangle (dpy, pixmap, gc, 0, 0, window_width, window_height);
       result |= transpPmapTiled;
       XFreeGC (dpy, gc);

@@ -1353,26 +1362,17 @@ bgPixmap_t::make_transparency_pixmap ()
           if ((flags & blurNeeded)
               && (flags & HAS_RENDER_CONV))
             {
-              if (blur_pixmap (tiled_root_pmap, target->visual, window_width, window_height))
+              if (blur_pixmap (pixmap, target->visual, window_width, window_height))
                 result |= transpPmapBlurred;
             }
           if ((flags & tintNeeded)
               && (flags & (tintWholesome | HAS_RENDER)))
             {
-              if (tint_pixmap (tiled_root_pmap, target->visual, window_width, window_height))
+              if (tint_pixmap (pixmap, target->visual, window_width, window_height))
                 result |= transpPmapTinted;
             }
         } /* server side rendering completed */
-
-      if (pixmap)
-        XFreePixmap (dpy, pixmap);
-
-      pixmap = tiled_root_pmap;
-      pmap_width = window_width;
-      pmap_height = window_height;
     }
-  else
-    XFreePixmap (dpy, tiled_root_pmap);

   if (recoded_root_pmap != root_pixmap)
     XFreePixmap (dpy, recoded_root_pmap);

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 11:31:33 2024