-- 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: c040b36eec452e612f4eea5a60cf345a5495af31:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

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

commit c040b36eec452e612f4eea5a60cf345a5495af31
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Sun Aug 29 16:10:42 2010 +0000

    Move afterimage specific code in render_asim.

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

index a49f58f4146755bc1f5b47363609b93fcef2d435..

index ..929ba2ff27712c1cb0a532ef084d4181279a4624 100644

--- a/src/background.C
+++ b/src/background.C
@@ -450,13 +450,48 @@ bgPixmap_t::set_geometry (const char *geom)

 #  ifdef HAVE_AFTERIMAGE
 bool
-bgPixmap_t::render_asim (ASImage *background, ARGB32 background_tint)
+bgPixmap_t::render_asim (unsigned long background_flags)
 {
   if (target == NULL)
     return false;

   target->init_asv ();

+  ASImage *background = NULL;
+  ARGB32 background_tint = TINT_LEAVE_SAME;
+
+#   ifdef ENABLE_TRANSPARENCY
+  if (background_flags)
+    background = pixmap2ximage (target->asv, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, 100);
+
+  if (!(background_flags & transpPmapTinted) && (flags & tintNeeded))
+    {
+      ShadingInfo as_shade;
+      as_shade.shading = (shade == 0) ? 100 : shade;
+
+      rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC);
+      if (flags & tintSet)
+        tint.get (c);
+      as_shade.tintColor.red = c.r;
+      as_shade.tintColor.green = c.g;
+      as_shade.tintColor.blue = c.b;
+
+      background_tint = shading2tint32 (&as_shade);
+    }
+
+  if (!(background_flags & transpPmapBlured) && (flags & blurNeeded) && background != NULL)
+    {
+      ASImage *tmp = blur_asimage_gauss (target->asv, background, h_blurRadius, v_blurRadius, 0xFFFFFFFF,
+                                         (original_asim == NULL || tint == TINT_LEAVE_SAME)?ASA_XImage:ASA_ASImage,
+                                         100, ASIMAGE_QUALITY_DEFAULT);
+      if (tmp)
+        {
+          destroy_asimage (&background);
+          background = tmp;
+        }
+    }
+#   endif
+
   ASImage *result = 0;

   int target_width    = target->szHint.width;
@@ -665,6 +700,9 @@ bgPixmap_t::render_asim (ASImage *background, ARGB32 background_tint)
       TIMING_TEST_PRINT_RESULT (asim);
     }

+  if (background)
+    destroy_asimage (&background);
+
   return true;
 }
 #  endif /* HAVE_AFTERIMAGE */
@@ -1142,46 +1180,8 @@ bgPixmap_t::render ()
   if (original_asim
       || (background_flags & transpTransformations) != (flags & transpTransformations))
     {
-      target->init_asv ();
-
-      ASImage *background = NULL;
-      ARGB32 as_tint = TINT_LEAVE_SAME;
-      if (background_flags)
-        background = pixmap2ximage (target->asv, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, 100);
-
-#  ifdef ENABLE_TRANSPARENCY
-      if (!(background_flags & transpPmapTinted) && (flags & tintNeeded))
-        {
-          ShadingInfo as_shade;
-          as_shade.shading = (shade == 0) ? 100 : shade;
-
-          rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC);
-          if (flags & tintSet)
-            tint.get (c);
-          as_shade.tintColor.red = c.r;
-          as_shade.tintColor.green = c.g;
-          as_shade.tintColor.blue = c.b;
-
-          as_tint = shading2tint32 (&as_shade);
-        }
-
-      if (!(background_flags & transpPmapBlured) && (flags & blurNeeded) && background != NULL)
-        {
-          ASImage *tmp = blur_asimage_gauss (target->asv, background, h_blurRadius, v_blurRadius, 0xFFFFFFFF,
-                                             (original_asim == NULL || tint == TINT_LEAVE_SAME)?ASA_XImage:ASA_ASImage,
-                                             100, ASIMAGE_QUALITY_DEFAULT);
-          if (tmp)
-            {
-              destroy_asimage (&background);
-              background = tmp;
-            }
-        }
-#  endif
-
-      if (render_asim (background, as_tint))
+      if (render_asim (background_flags))
         flags = flags & ~isInvalid;
-      if (background)
-        destroy_asimage (&background);
     }
   else if (background_flags && pmap_depth != target->depth)
     result = XGetImage (target->dpy, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, ZPixmap);
diff --git a/src/background.h b/src/background.h

index 9b6a0b2374f5dca3c5e51920726733db2c5080b5..

index ..7db6e0d3d7753d1184ea303cd0a921b931e1b024 100644

--- a/src/background.h
+++ b/src/background.h
@@ -58,7 +58,7 @@ struct bgPixmap_t
 # ifdef  BG_IMAGE_FROM_FILE
 #  ifdef HAVE_AFTERIMAGE
   ASImage *original_asim;
-  bool render_asim (ASImage *background, ARGB32 background_tint);
+  bool render_asim (unsigned long background_flags);
 #  endif

   enum {

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

-- Response ended

-- Page fetched on Sun Jun 2 13:24:39 2024