-- 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:
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
--- 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
--- 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