ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/background.C
(Generate patch)

Comparing rxvt-unicode/src/background.C (file contents):
Revision 1.44 by sf-exg, Sun Aug 29 15:12:41 2010 UTC vs.
Revision 1.45 by sf-exg, Sun Aug 29 16:10:42 2010 UTC

448 return (changed > 0); 448 return (changed > 0);
449} 449}
450 450
451# ifdef HAVE_AFTERIMAGE 451# ifdef HAVE_AFTERIMAGE
452bool 452bool
453bgPixmap_t::render_asim (ASImage *background, ARGB32 background_tint) 453bgPixmap_t::render_asim (unsigned long background_flags)
454{ 454{
455 if (target == NULL) 455 if (target == NULL)
456 return false; 456 return false;
457 457
458 target->init_asv (); 458 target->init_asv ();
459
460 ASImage *background = NULL;
461 ARGB32 background_tint = TINT_LEAVE_SAME;
462
463# ifdef ENABLE_TRANSPARENCY
464 if (background_flags)
465 background = pixmap2ximage (target->asv, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, 100);
466
467 if (!(background_flags & transpPmapTinted) && (flags & tintNeeded))
468 {
469 ShadingInfo as_shade;
470 as_shade.shading = (shade == 0) ? 100 : shade;
471
472 rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC);
473 if (flags & tintSet)
474 tint.get (c);
475 as_shade.tintColor.red = c.r;
476 as_shade.tintColor.green = c.g;
477 as_shade.tintColor.blue = c.b;
478
479 background_tint = shading2tint32 (&as_shade);
480 }
481
482 if (!(background_flags & transpPmapBlured) && (flags & blurNeeded) && background != NULL)
483 {
484 ASImage *tmp = blur_asimage_gauss (target->asv, background, h_blurRadius, v_blurRadius, 0xFFFFFFFF,
485 (original_asim == NULL || tint == TINT_LEAVE_SAME)?ASA_XImage:ASA_ASImage,
486 100, ASIMAGE_QUALITY_DEFAULT);
487 if (tmp)
488 {
489 destroy_asimage (&background);
490 background = tmp;
491 }
492 }
493# endif
459 494
460 ASImage *result = 0; 495 ASImage *result = 0;
461 496
462 int target_width = target->szHint.width; 497 int target_width = target->szHint.width;
463 int target_height = target->szHint.height; 498 int target_height = target->szHint.height;
662 destroy_asimage (&result); 697 destroy_asimage (&result);
663 698
664 XFreeGC (target->dpy, gc); 699 XFreeGC (target->dpy, gc);
665 TIMING_TEST_PRINT_RESULT (asim); 700 TIMING_TEST_PRINT_RESULT (asim);
666 } 701 }
702
703 if (background)
704 destroy_asimage (&background);
667 705
668 return true; 706 return true;
669} 707}
670# endif /* HAVE_AFTERIMAGE */ 708# endif /* HAVE_AFTERIMAGE */
671 709
1140 XImage *result = NULL; 1178 XImage *result = NULL;
1141# ifdef HAVE_AFTERIMAGE 1179# ifdef HAVE_AFTERIMAGE
1142 if (original_asim 1180 if (original_asim
1143 || (background_flags & transpTransformations) != (flags & transpTransformations)) 1181 || (background_flags & transpTransformations) != (flags & transpTransformations))
1144 { 1182 {
1145 target->init_asv ();
1146
1147 ASImage *background = NULL;
1148 ARGB32 as_tint = TINT_LEAVE_SAME;
1149 if (background_flags)
1150 background = pixmap2ximage (target->asv, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, 100);
1151
1152# ifdef ENABLE_TRANSPARENCY
1153 if (!(background_flags & transpPmapTinted) && (flags & tintNeeded))
1154 {
1155 ShadingInfo as_shade;
1156 as_shade.shading = (shade == 0) ? 100 : shade;
1157
1158 rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC);
1159 if (flags & tintSet)
1160 tint.get (c);
1161 as_shade.tintColor.red = c.r;
1162 as_shade.tintColor.green = c.g;
1163 as_shade.tintColor.blue = c.b;
1164
1165 as_tint = shading2tint32 (&as_shade);
1166 }
1167
1168 if (!(background_flags & transpPmapBlured) && (flags & blurNeeded) && background != NULL)
1169 {
1170 ASImage *tmp = blur_asimage_gauss (target->asv, background, h_blurRadius, v_blurRadius, 0xFFFFFFFF,
1171 (original_asim == NULL || tint == TINT_LEAVE_SAME)?ASA_XImage:ASA_ASImage,
1172 100, ASIMAGE_QUALITY_DEFAULT);
1173 if (tmp)
1174 {
1175 destroy_asimage (&background);
1176 background = tmp;
1177 }
1178 }
1179# endif
1180
1181 if (render_asim (background, as_tint)) 1183 if (render_asim (background_flags))
1182 flags = flags & ~isInvalid; 1184 flags = flags & ~isInvalid;
1183 if (background)
1184 destroy_asimage (&background);
1185 } 1185 }
1186 else if (background_flags && pmap_depth != target->depth) 1186 else if (background_flags && pmap_depth != target->depth)
1187 result = XGetImage (target->dpy, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, ZPixmap); 1187 result = XGetImage (target->dpy, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, ZPixmap);
1188 1188
1189# elif !XFT /* our own client-side tinting */ 1189# elif !XFT /* our own client-side tinting */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines