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.22 by sasha, Fri Jan 4 21:25:57 2008 UTC vs.
Revision 1.52 by sf-exg, Wed Sep 1 11:59:44 2010 UTC

1/*----------------------------------------------------------------------* 1/*----------------------------------------------------------------------*
2 * File: background.C - former xpm.C 2 * File: background.C - former xpm.C
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * 4 *
5 * All portions of code are copyright by their respective author/s. 5 * All portions of code are copyright by their respective author/s.
6 * Copyright (c) 2005-2006 Marc Lehmann <pcg@goof.com> 6 * Copyright (c) 2005-2008 Marc Lehmann <pcg@goof.com>
7 * Copyright (c) 2007 Sasha Vasko <sasha@aftercode.net> 7 * Copyright (c) 2007 Sasha Vasko <sasha@aftercode.net>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or 11 * the Free Software Foundation; either version 2 of the License, or
27#define DO_TIMING_TEST 0 27#define DO_TIMING_TEST 0
28 28
29#if DO_TIMING_TEST 29#if DO_TIMING_TEST
30# include <sys/time.h> 30# include <sys/time.h>
31#define TIMING_TEST_START(id) \ 31#define TIMING_TEST_START(id) \
32 struct timeval timing_test_##id##_stv;\ 32 struct timeval timing_test_##id##_stv; \
33 gettimeofday (&timing_test_##id##_stv, NULL); 33 gettimeofday (&timing_test_##id##_stv, NULL);
34 34
35#define TIMING_TEST_PRINT_RESULT(id) \ 35#define TIMING_TEST_PRINT_RESULT(id) \
36 do{ struct timeval tv;gettimeofday (&tv, NULL); tv.tv_sec -= (timing_test_##id##_stv).tv_sec;\ 36 do { \
37 struct timeval tv; \
38 gettimeofday (&tv, NULL); \
39 tv.tv_sec -= (timing_test_##id##_stv).tv_sec; \
37 fprintf (stderr, "%s: %s: %d: elapsed %ld usec\n", #id, __FILE__, __LINE__,\ 40 fprintf (stderr, "%s: %s: %d: elapsed %ld usec\n", #id, __FILE__, __LINE__, \
38 tv.tv_sec * 1000000 + tv.tv_usec - (timing_test_##id##_stv).tv_usec);}while (0) 41 tv.tv_sec * 1000000 + tv.tv_usec - (timing_test_##id##_stv).tv_usec); \
42 } while (0)
39 43
40#else 44#else
41#define TIMING_TEST_START(id) do{}while (0) 45#define TIMING_TEST_START(id) do {} while (0)
42#define TIMING_TEST_PRINT_RESULT(id) do{}while (0) 46#define TIMING_TEST_PRINT_RESULT(id) do {} while (0)
43#endif 47#endif
44 48
45/* 49/*
46 * Pixmap geometry string interpretation : 50 * Pixmap geometry string interpretation :
47 * Each geometry string contains zero or one scale/position 51 * Each geometry string contains zero or one scale/position
48 * adjustment and may optionally be followed by a colon and one or more 52 * adjustment and may optionally be followed by a colon and one or more
49 * colon-delimited pixmap operations. 53 * colon-delimited pixmap operations.
50 * The following table shows the valid geometry strings and their 54 * The following table shows the valid geometry strings and their
51 * affects on the background image : 55 * effects on the background image :
52 * 56 *
53 * WxH+X+Y Set scaling to W% by H%, and position to X% by Y%. 57 * WxH+X+Y Set scaling to W% by H%, and position to X% by Y%.
54 * W and H are percentages of the terminal window size. 58 * W and H are percentages of the terminal window size.
55 * X and Y are also percentages; e.g., +50+50 centers 59 * X and Y are also percentages; e.g., +50+50 centers
56 * the image in the window. 60 * the image in the window.
87 */ 91 */
88 92
89#ifdef HAVE_BG_PIXMAP 93#ifdef HAVE_BG_PIXMAP
90bgPixmap_t::bgPixmap_t () 94bgPixmap_t::bgPixmap_t ()
91{ 95{
96 // this is basically redundant as bgPixmap_t is only used in
97 // zero_initialised-derived structs
92#ifdef HAVE_AFTERIMAGE 98#ifdef HAVE_AFTERIMAGE
93 original_asim = NULL; 99 original_asim = NULL;
94#endif 100#endif
95#ifdef BG_IMAGE_FROM_FILE 101#ifdef BG_IMAGE_FROM_FILE
102 have_image = false;
96 h_scale = v_scale = 0; 103 h_scale = v_scale = 0;
97 h_align = v_align = 0; 104 h_align = v_align = 0;
98#endif 105#endif
99 flags = 0; 106 flags = 0;
100 pixmap = None; 107 pixmap = None;
101 valid_since = invalid_since = 0; 108 valid_since = invalid_since = 0;
109 target = 0;
102} 110}
103 111
104void 112void
105bgPixmap_t::destroy () 113bgPixmap_t::destroy ()
106{ 114{
120 if (flags & isTransparent) 128 if (flags & isTransparent)
121 return true; 129 return true;
122# endif 130# endif
123 131
124# ifdef BG_IMAGE_FROM_FILE 132# ifdef BG_IMAGE_FROM_FILE
125# ifdef HAVE_AFTERIMAGE 133 if (have_image)
126 if (original_asim != NULL)
127# endif
128 { 134 {
129 if (h_scale != 0 || v_scale != 0 135 if (h_scale != 0 || v_scale != 0
130 || h_align != 0 || v_align != 0) 136 || h_align != 0 || v_align != 0)
131 return true; 137 return true;
132 } 138 }
133# endif 139# endif
134 140
135 return false; 141 return false;
136} 142}
137 143
138bool 144bool
139bgPixmap_t::window_position_sensitive () 145bgPixmap_t::window_position_sensitive ()
140{ 146{
141# ifdef ENABLE_TRANSPARENCY 147# ifdef ENABLE_TRANSPARENCY
142 if (flags & isTransparent) 148 if (flags & isTransparent)
143 return true; 149 return true;
144# endif 150# endif
145 151
146# ifdef BG_IMAGE_FROM_FILE 152# ifdef BG_IMAGE_FROM_FILE
147# ifdef HAVE_AFTERIMAGE 153 if (have_image)
148 if (original_asim != NULL)
149# endif
150 { 154 {
151 if (h_align == rootAlign || v_align == rootAlign) 155 if (h_align == rootAlign || v_align == rootAlign)
152 return true; 156 return true;
153 } 157 }
154# endif 158# endif
157}; 161};
158 162
159bool bgPixmap_t::need_client_side_rendering () 163bool bgPixmap_t::need_client_side_rendering ()
160{ 164{
161# ifdef HAVE_AFTERIMAGE 165# ifdef HAVE_AFTERIMAGE
162 if (original_asim != NULL) 166 if (original_asim)
163 return true; 167 return true;
164# endif 168# endif
165# ifdef ENABLE_TRANSPARENCY 169# ifdef ENABLE_TRANSPARENCY
166 if (flags & isTransparent) 170 if (flags & isTransparent)
167 { 171 {
256 int geom_flags = 0, changed = 0; 260 int geom_flags = 0, changed = 0;
257 int x = 0, y = 0; 261 int x = 0, y = 0;
258 unsigned int w = 0, h = 0; 262 unsigned int w = 0, h = 0;
259 unsigned int n; 263 unsigned int n;
260 unsigned long new_flags = (flags & (~geometryFlags)); 264 unsigned long new_flags = (flags & (~geometryFlags));
261 char *p; 265 const char *p;
262# define MAXLEN_GEOM 256 /* could be longer then regular geometry string */ 266# define MAXLEN_GEOM 256 /* could be longer than regular geometry string */
263 267
264 if (geom == NULL) 268 if (geom == NULL)
265 return false; 269 return false;
266 270
267 char str[MAXLEN_GEOM]; 271 char str[MAXLEN_GEOM];
274 if (n < MAXLEN_GEOM) 278 if (n < MAXLEN_GEOM)
275 { 279 {
276 char *ops; 280 char *ops;
277 new_flags |= geometrySet; 281 new_flags |= geometrySet;
278 282
279 strncpy (str, geom, n); 283 memcpy (str, geom, n);
280 str[n] = '\0'; 284 str[n] = '\0';
281 if (str[0] == ':') 285 if (str[0] == ':')
282 ops = &str[0]; 286 ops = &str[0];
283 else if (str[0] != 'x' && str[0] != 'X' && isalpha(str[0])) 287 else if (str[0] != 'x' && str[0] != 'X' && isalpha(str[0]))
284 ops = &str[0]; 288 ops = &str[0];
367 if (ops) 371 if (ops)
368 { 372 {
369 while (*ops) 373 while (*ops)
370 { 374 {
371 while (*ops == ':' || isspace(*ops)) ++ops; 375 while (*ops == ':' || isspace(*ops)) ++ops;
376
372# define CHECK_GEOM_OPS(op_str) (strncasecmp (ops, (op_str), sizeof(op_str)-1) == 0) 377# define CHECK_GEOM_OPS(op_str) (strncasecmp (ops, (op_str), sizeof (op_str) - 1) == 0)
373 if (CHECK_GEOM_OPS("tile")) 378 if (CHECK_GEOM_OPS ("tile"))
374 { 379 {
375 w = h = noScale; 380 w = h = noScale;
376 geom_flags |= WidthValue|HeightValue; 381 geom_flags |= WidthValue|HeightValue;
377 } 382 }
378 else if (CHECK_GEOM_OPS("propscale")) 383 else if (CHECK_GEOM_OPS ("propscale"))
379 { 384 {
380 if (w == 0 && h == 0) 385 if (w == 0 && h == 0)
381 { 386 {
382 w = windowScale; 387 w = windowScale;
383 geom_flags |= WidthValue; 388 geom_flags |= WidthValue;
384 } 389 }
385 new_flags |= propScale; 390 new_flags |= propScale;
386 } 391 }
387 else if (CHECK_GEOM_OPS("hscale")) 392 else if (CHECK_GEOM_OPS ("hscale"))
388 { 393 {
389 if (w == 0)
390 w = windowScale; 394 if (w == 0) w = windowScale;
395
391 h = noScale; 396 h = noScale;
392 geom_flags |= WidthValue|HeightValue; 397 geom_flags |= WidthValue|HeightValue;
393 } 398 }
394 else if (CHECK_GEOM_OPS("vscale")) 399 else if (CHECK_GEOM_OPS ("vscale"))
395 { 400 {
396 if (h == 0)
397 h = windowScale; 401 if (h == 0) h = windowScale;
402
398 w = noScale; 403 w = noScale;
399 geom_flags |= WidthValue|HeightValue; 404 geom_flags |= WidthValue|HeightValue;
400 } 405 }
401 else if (CHECK_GEOM_OPS("scale")) 406 else if (CHECK_GEOM_OPS ("scale"))
402 { 407 {
403 if (h == 0)
404 h = windowScale; 408 if (h == 0) h = windowScale;
405 if (w == 0)
406 w = windowScale; 409 if (w == 0) w = windowScale;
410
407 geom_flags |= WidthValue|HeightValue; 411 geom_flags |= WidthValue|HeightValue;
408 } 412 }
409 else if (CHECK_GEOM_OPS("auto")) 413 else if (CHECK_GEOM_OPS ("auto"))
410 { 414 {
411 w = h = windowScale; 415 w = h = windowScale;
412 x = y = centerAlign; 416 x = y = centerAlign;
413 geom_flags |= WidthValue|HeightValue|XValue|YValue; 417 geom_flags |= WidthValue|HeightValue|XValue|YValue;
414 } 418 }
415 else if (CHECK_GEOM_OPS("root")) 419 else if (CHECK_GEOM_OPS ("root"))
416 { 420 {
417 w = h = noScale; 421 w = h = noScale;
418 x = y = rootAlign; 422 x = y = rootAlign;
419 geom_flags |= WidthValue|HeightValue|XValue|YValue; 423 geom_flags |= WidthValue|HeightValue|XValue|YValue;
420 } 424 }
421# undef CHECK_GEOM_OPS 425# undef CHECK_GEOM_OPS
426
422 while (*ops != ':' && *ops != '\0') ++ops; 427 while (*ops != ':' && *ops != '\0') ++ops;
423 } /* done parsing ops */ 428 } /* done parsing ops */
424 } 429 }
425 430
426 if (check_set_scale_value (geom_flags, WidthValue, h_scale, w)) 431 if (check_set_scale_value (geom_flags, WidthValue, h_scale, w)) ++changed;
427 ++changed;
428 if (check_set_scale_value (geom_flags, HeightValue, v_scale, h)) 432 if (check_set_scale_value (geom_flags, HeightValue, v_scale, h)) ++changed;
429 ++changed;
430 if (check_set_align_value (geom_flags, XValue, h_align, x)) 433 if (check_set_align_value (geom_flags, XValue, h_align, x)) ++changed;
431 ++changed;
432 if (check_set_align_value (geom_flags, YValue, v_align, y)) 434 if (check_set_align_value (geom_flags, YValue, v_align, y)) ++changed;
433 ++changed;
434 } 435 }
435 436
436 if (new_flags != flags) 437 if (new_flags != flags)
437 { 438 {
438 flags = new_flags; 439 flags = new_flags;
439 changed++; 440 changed++;
440 } 441 }
442
441//fprintf (stderr, "flags = %lX, scale = %ux%u, align=%+d%+d\n", 443 //fprintf (stderr, "flags = %lX, scale = %ux%u, align=%+d%+d\n",
442// flags, h_scale, v_scale, h_align, v_align); 444 // flags, h_scale, v_scale, h_align, v_align);
443 return (changed > 0); 445 return (changed > 0);
444} 446}
445 447
446# ifdef HAVE_AFTERIMAGE 448# ifdef HAVE_AFTERIMAGE
447bool 449bool
448bgPixmap_t::render_asim (ASImage *background, ARGB32 background_tint) 450bgPixmap_t::render_image (unsigned long background_flags)
449{ 451{
450 if (target == NULL) 452 if (target == NULL)
451 return false; 453 return false;
452 454
455 target->init_asv ();
456
457 ASImage *background = NULL;
458 ARGB32 background_tint = TINT_LEAVE_SAME;
459
460# ifdef ENABLE_TRANSPARENCY
461 if (background_flags)
462 background = pixmap2ximage (target->asv, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, 100);
463
464 if (!(background_flags & transpPmapTinted) && (flags & tintNeeded))
465 {
466 ShadingInfo as_shade;
467 as_shade.shading = (shade == 0) ? 100 : shade;
468
469 rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC);
470 if (flags & tintSet)
471 tint.get (c);
472 as_shade.tintColor.red = c.r;
473 as_shade.tintColor.green = c.g;
474 as_shade.tintColor.blue = c.b;
475
476 background_tint = shading2tint32 (&as_shade);
477 }
478
479 if (!(background_flags & transpPmapBlured) && (flags & blurNeeded) && background != NULL)
480 {
481 ASImage *tmp = blur_asimage_gauss (target->asv, background, h_blurRadius, v_blurRadius, 0xFFFFFFFF,
482 (original_asim == NULL || tint == TINT_LEAVE_SAME) ? ASA_XImage : ASA_ASImage,
483 100, ASIMAGE_QUALITY_DEFAULT);
484 if (tmp)
485 {
486 destroy_asimage (&background);
487 background = tmp;
488 }
489 }
490# endif
491
492 ASImage *result = 0;
493
453 int target_width = (int)target->szHint.width; 494 int target_width = target->szHint.width;
454 int target_height = (int)target->szHint.height; 495 int target_height = target->szHint.height;
455 int new_pmap_width = target_width, new_pmap_height = target_height; 496 int new_pmap_width = target_width;
456 ASImage *result = NULL; 497 int new_pmap_height = target_height;
457 498
458 int x = 0; 499 int x = 0;
459 int y = 0; 500 int y = 0;
460 int w = h_scale * target_width / 100; 501 int w = h_scale * target_width / 100;
461 int h = v_scale * target_height / 100; 502 int h = v_scale * target_height / 100;
464 505
465 if (original_asim) 506 if (original_asim)
466 { 507 {
467 if (h_align == rootAlign || v_align == rootAlign) 508 if (h_align == rootAlign || v_align == rootAlign)
468 { 509 {
469 target->get_window_origin(x, y); 510 target->get_window_origin (x, y);
470 x = -x; 511 x = -x;
471 y = -y; 512 y = -y;
472 } 513 }
514
473 if (h_align != rootAlign) 515 if (h_align != rootAlign)
474 x = make_align_position (h_align, target_width, w > 0 ? w : (int)original_asim->width); 516 x = make_align_position (h_align, target_width, w > 0 ? w : (int)original_asim->width);
517
475 if (v_align != rootAlign) 518 if (v_align != rootAlign)
476 y = make_align_position (v_align, target_height, h > 0 ? h : (int)original_asim->height); 519 y = make_align_position (v_align, target_height, h > 0 ? h : (int)original_asim->height);
477 } 520 }
478 521
479 if (original_asim == NULL 522 if (!original_asim
480 || x >= target_width 523 || x >= target_width
481 || y >= target_height 524 || y >= target_height
482 || (w > 0 && x + w <= 0) 525 || (w > 0 && x + w <= 0)
483 || (h > 0 && y + h <= 0)) 526 || (h > 0 && y + h <= 0))
484 { 527 {
485 if (background) 528 if (background)
486 { 529 {
487 new_pmap_width = background->width; 530 new_pmap_width = background->width;
488 new_pmap_height = background->height; 531 new_pmap_height = background->height;
489 result = background; 532 result = background;
533
490 if (background_tint != TINT_LEAVE_SAME) 534 if (background_tint != TINT_LEAVE_SAME)
491 { 535 {
492 ASImage* tmp = tile_asimage (target->asv, background, 0, 0, 536 ASImage *tmp = tile_asimage (target->asv, background, 0, 0,
493 target_width, target_height, background_tint, 537 target_width, target_height, background_tint,
494 ASA_XImage, 100, ASIMAGE_QUALITY_DEFAULT); 538 ASA_XImage, 100, ASIMAGE_QUALITY_DEFAULT);
495 if (tmp) 539 if (tmp)
496 result = tmp; 540 result = tmp;
497 } 541 }
500 new_pmap_width = new_pmap_height = 0; 544 new_pmap_width = new_pmap_height = 0;
501 } 545 }
502 else 546 else
503 { 547 {
504 result = original_asim; 548 result = original_asim;
549
505 if ((w > 0 && w != original_asim->width) 550 if ((w > 0 && w != original_asim->width)
506 || (h > 0 && h != original_asim->height)) 551 || (h > 0 && h != original_asim->height))
507 { 552 {
508 result = scale_asimage (target->asv, original_asim, 553 result = scale_asimage (target->asv, original_asim,
509 w > 0 ? w : original_asim->width, 554 w > 0 ? w : original_asim->width,
510 h > 0 ? h : original_asim->height, 555 h > 0 ? h : original_asim->height,
511 background ? ASA_ASImage : ASA_XImage, 556 background ? ASA_ASImage : ASA_XImage,
512 100, ASIMAGE_QUALITY_DEFAULT); 557 100, ASIMAGE_QUALITY_DEFAULT);
513 } 558 }
559
514 if (background == NULL) 560 if (background == NULL)
515 { 561 {
516 /* if tiling - pixmap has to be sized exactly as the image, 562 /* if tiling - pixmap has to be sized exactly as the image,
517 but there is no need to make it bigger then the window! */ 563 but there is no need to make it bigger than the window! */
518 if (h_scale == 0) 564 if (h_scale == 0)
519 new_pmap_width = min (result->width, target_width); 565 new_pmap_width = min (result->width, target_width);
520 if (v_scale == 0) 566 if (v_scale == 0)
521 new_pmap_height = min (result->height, target_height); 567 new_pmap_height = min (result->height, target_height);
522 /* we also need to tile our image in one or both directions */ 568 /* we also need to tile our image in one or both directions */
523 if (h_scale == 0 || v_scale == 0) 569 if (h_scale == 0 || v_scale == 0)
524 { 570 {
525 ASImage *tmp = tile_asimage (target->asv, result, 571 ASImage *tmp = tile_asimage (target->asv, result,
526 (h_scale > 0) ? 0 : (int)result->width - x, 572 (h_scale > 0) ? 0 : (int)result->width - x,
527 (v_scale > 0) ? 0 : (int)result->height - y, 573 (v_scale > 0) ? 0 : (int)result->height - y,
528 new_pmap_width, 574 new_pmap_width,
529 new_pmap_height, 575 new_pmap_height,
530 TINT_LEAVE_SAME, ASA_XImage, 576 TINT_LEAVE_SAME, ASA_XImage,
531 100, ASIMAGE_QUALITY_DEFAULT); 577 100, ASIMAGE_QUALITY_DEFAULT);
532 if (tmp) 578 if (tmp)
533 { 579 {
534 if (result != original_asim) 580 if (result != original_asim)
535 destroy_asimage (&result); 581 destroy_asimage (&result);
582
536 result = tmp; 583 result = tmp;
537 } 584 }
538 } 585 }
539 } 586 }
540 else 587 else
541 { 588 {
542 /* if blending background and image - pixmap has to be sized same as target window */ 589 /* if blending background and image - pixmap has to be sized same as target window */
543 ASImageLayer *layers = create_image_layers (2); 590 ASImageLayer *layers = create_image_layers (2);
544 ASImage *merged_im = NULL;
545 591
546 layers[0].im = background; 592 layers[0].im = background;
547 layers[0].clip_width = target_width; 593 layers[0].clip_width = target_width;
548 layers[0].clip_height = target_height; 594 layers[0].clip_height = target_height;
549 layers[0].tint = background_tint; 595 layers[0].tint = background_tint;
550 layers[1].im = result; 596 layers[1].im = result;
597
551 if (w <= 0) 598 if (w <= 0)
552 { 599 {
553 /* tile horizontally */ 600 /* tile horizontally */
554 while (x > 0) x -= (int)result->width; 601 while (x > 0) x -= (int)result->width;
555 layers[1].dst_x = x; 602 layers[1].dst_x = x;
559 { 606 {
560 /* clip horizontally */ 607 /* clip horizontally */
561 layers[1].dst_x = x; 608 layers[1].dst_x = x;
562 layers[1].clip_width = result->width; 609 layers[1].clip_width = result->width;
563 } 610 }
611
564 if (h <= 0) 612 if (h <= 0)
565 { 613 {
566 while (y > 0) y -= (int)result->height; 614 while (y > 0) y -= (int)result->height;
567 layers[1].dst_y = y; 615 layers[1].dst_y = y;
568 layers[1].clip_height = result->height + target_height; 616 layers[1].clip_height = result->height + target_height;
570 else 618 else
571 { 619 {
572 layers[1].dst_y = y; 620 layers[1].dst_y = y;
573 layers[1].clip_height = result->height; 621 layers[1].clip_height = result->height;
574 } 622 }
623
575 if (target->rs[Rs_blendtype]) 624 if (target->rs[Rs_blendtype])
576 { 625 {
577 layers[1].merge_scanlines = blend_scanlines_name2func (target->rs[Rs_blendtype]); 626 layers[1].merge_scanlines = blend_scanlines_name2func (target->rs[Rs_blendtype]);
578 if (layers[1].merge_scanlines == NULL) 627 if (layers[1].merge_scanlines == NULL)
579 layers[1].merge_scanlines = alphablend_scanlines; 628 layers[1].merge_scanlines = alphablend_scanlines;
580 } 629 }
630
581 ASImage *tmp = merge_layers (target->asv, layers, 2, target_width, target_height, 631 ASImage *tmp = merge_layers (target->asv, layers, 2, target_width, target_height,
582 ASA_XImage, 0, ASIMAGE_QUALITY_DEFAULT); 632 ASA_XImage, 0, ASIMAGE_QUALITY_DEFAULT);
633
583 if (tmp) 634 if (tmp)
584 { 635 {
585 if (result != original_asim) 636 if (result != original_asim)
586 destroy_asimage (&result); 637 destroy_asimage (&result);
638
587 result = tmp; 639 result = tmp;
588 } 640 }
641
589 free (layers); 642 free (layers);
590 } 643 }
591 } 644 }
592 TIMING_TEST_PRINT_RESULT (asim); 645 TIMING_TEST_PRINT_RESULT (asim);
593 646
594 if (pixmap) 647 bool ret = false;
595 {
596 if (result == NULL
597 || pmap_width != new_pmap_width
598 || pmap_height != new_pmap_height
599 || pmap_depth != target->depth)
600 {
601 XFreePixmap (target->dpy, pixmap);
602 pixmap = None;
603 }
604 }
605 648
606 if (result) 649 if (result)
607 { 650 {
608 XGCValues gcv; 651 XGCValues gcv;
609 GC gc; 652 GC gc;
653
654 if (pixmap)
655 {
656 if (pmap_width != new_pmap_width
657 || pmap_height != new_pmap_height
658 || pmap_depth != target->depth)
659 {
660 XFreePixmap (target->dpy, pixmap);
661 pixmap = None;
662 }
663 }
610 664
611 /* create Pixmap */ 665 /* create Pixmap */
612 if (pixmap == None) 666 if (pixmap == None)
613 { 667 {
614 pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth); 668 pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth);
615 pmap_width = new_pmap_width; 669 pmap_width = new_pmap_width;
616 pmap_height = new_pmap_height; 670 pmap_height = new_pmap_height;
617 pmap_depth = target->depth; 671 pmap_depth = target->depth;
618 } 672 }
619 /* fill with background color ( if result's not completely overlapping it)*/ 673 /* fill with background color (if result's not completely overlapping it) */
620 gcv.foreground = target->pix_colors[Color_bg]; 674 gcv.foreground = target->pix_colors[Color_bg];
621 gc = XCreateGC (target->dpy, target->vt, GCForeground, &gcv); 675 gc = XCreateGC (target->dpy, target->vt, GCForeground, &gcv);
622 676
623 int src_x = 0, src_y = 0, dst_x = 0, dst_y = 0; 677 int src_x = 0, src_y = 0, dst_x = 0, dst_y = 0;
624 int dst_width = result->width, dst_height = result->height; 678 int dst_width = result->width, dst_height = result->height;
625 if (background == NULL) 679 if (background == NULL)
626 { 680 {
627 if (h_scale > 0)
628 src_x = make_clip_rectangle (x, result->width, new_pmap_width, dst_x, dst_width); 681 if (h_scale > 0) src_x = make_clip_rectangle (x, result->width , new_pmap_width , dst_x, dst_width );
629 if (v_scale > 0)
630 src_y = make_clip_rectangle (y, result->height, new_pmap_height, dst_y, dst_height); 682 if (v_scale > 0) src_y = make_clip_rectangle (y, result->height, new_pmap_height, dst_y, dst_height);
631 683
632 if (dst_x > 0 || dst_y > 0 684 if (dst_x > 0 || dst_y > 0
633 || dst_x + dst_width < new_pmap_width 685 || dst_x + dst_width < new_pmap_width
634 || dst_y + dst_height < new_pmap_height) 686 || dst_y + dst_height < new_pmap_height)
635 {
636 XFillRectangle (target->dpy, pixmap, gc, 0, 0, new_pmap_width, new_pmap_height); 687 XFillRectangle (target->dpy, pixmap, gc, 0, 0, new_pmap_width, new_pmap_height);
637 }
638 } 688 }
639 689
640 /* put result on pixmap */ 690 /* put result on pixmap */
641 if (dst_x < new_pmap_width && dst_y < new_pmap_height) 691 if (dst_x < new_pmap_width && dst_y < new_pmap_height)
642 asimage2drawable (target->asv, pixmap, result, gc, src_x, src_y, dst_x, dst_y, dst_width, dst_height, True); 692 asimage2drawable (target->asv, pixmap, result, gc, src_x, src_y, dst_x, dst_y, dst_width, dst_height, True);
644 if (result != background && result != original_asim) 694 if (result != background && result != original_asim)
645 destroy_asimage (&result); 695 destroy_asimage (&result);
646 696
647 XFreeGC (target->dpy, gc); 697 XFreeGC (target->dpy, gc);
648 TIMING_TEST_PRINT_RESULT (asim); 698 TIMING_TEST_PRINT_RESULT (asim);
649 }
650 699
700 ret = true;
701 }
702
703 if (background)
704 destroy_asimage (&background);
705
651 return true; 706 return ret;
652} 707}
653# endif /* HAVE_AFTERIMAGE */ 708# endif /* HAVE_AFTERIMAGE */
654 709
655bool 710bool
656bgPixmap_t::set_file (const char *file) 711bgPixmap_t::set_file (const char *file)
657{ 712{
658 char *f;
659
660 assert (file != NULL); 713 assert (file);
661 714
662 if (*file != '\0') 715 if (*file)
663 { 716 {
717 if (const char *p = strchr (file, ';'))
718 {
719 size_t len = p - file;
720 char *f = rxvt_temp_buf<char> (len + 1);
721 memcpy (f, file, len);
722 f[len] = '\0';
723 file = f;
724 }
725
664# ifdef HAVE_AFTERIMAGE 726# ifdef HAVE_AFTERIMAGE
665 if (target->asimman == NULL) 727 if (!target->asimman)
666 target->asimman = create_generic_imageman (target->rs[Rs_path]); 728 target->asimman = create_generic_imageman (target->rs[Rs_path]);
667 if ((f = strchr (file, ';')) == NULL)
668 original_asim = get_asimage (target->asimman, file, 0xFFFFFFFF, 100); 729 original_asim = get_asimage (target->asimman, file, 0xFFFFFFFF, 100);
669 else 730 if (original_asim)
670 { 731 have_image = true;
671 size_t len = f - file; 732 return have_image;
672 f = (char *)malloc (len + 1);
673 strncpy (f, file, len);
674 f[len] = '\0';
675 original_asim = get_asimage (target->asimman, f, 0xFFFFFFFF, 100);
676 free (f);
677 }
678 return (original_asim != NULL);
679# endif 733# endif
680 } 734 }
735
681 return false; 736 return false;
682} 737}
683 738
684# endif /* BG_IMAGE_FROM_FILE */ 739# endif /* BG_IMAGE_FROM_FILE */
685 740
690 if (!(flags & isTransparent)) 745 if (!(flags & isTransparent))
691 { 746 {
692 flags |= isTransparent; 747 flags |= isTransparent;
693 return true; 748 return true;
694 } 749 }
750
695 return false; 751 return false;
696} 752}
697 753
698bool 754bool
699bgPixmap_t::set_blur_radius (const char *geom) 755bgPixmap_t::set_blur_radius (const char *geom)
701 int changed = 0; 757 int changed = 0;
702 unsigned int hr, vr; 758 unsigned int hr, vr;
703 int junk; 759 int junk;
704 int geom_flags = XParseGeometry (geom, &junk, &junk, &hr, &vr); 760 int geom_flags = XParseGeometry (geom, &junk, &junk, &hr, &vr);
705 761
706 if (!(geom_flags&WidthValue)) 762 if (!(geom_flags & WidthValue))
707 hr = 1; 763 hr = 1;
708 if (!(geom_flags&HeightValue)) 764 if (!(geom_flags & HeightValue))
709 vr = hr; 765 vr = hr;
710 766
711 if (h_blurRadius != hr) 767 if (h_blurRadius != hr)
712 { 768 {
713 ++changed; 769 ++changed;
723 if (v_blurRadius == 0 && h_blurRadius == 0) 779 if (v_blurRadius == 0 && h_blurRadius == 0)
724 flags &= ~blurNeeded; 780 flags &= ~blurNeeded;
725 else 781 else
726 flags |= blurNeeded; 782 flags |= blurNeeded;
727 783
728 return (changed>0); 784 return (changed > 0);
729} 785}
730 786
731static inline unsigned long 787static inline unsigned long
732compute_tint_shade_flags (rxvt_color *tint, int shade) 788compute_tint_shade_flags (rxvt_color *tint, int shade)
733{ 789{
750 flags |= bgPixmap_t::tintNeeded; 806 flags |= bgPixmap_t::tintNeeded;
751 else if (tint) 807 else if (tint)
752 { 808 {
753 if ((c.r > 0x000700 || c.g > 0x000700 || c.b > 0x000700) 809 if ((c.r > 0x000700 || c.g > 0x000700 || c.b > 0x000700)
754 && (c.r < 0x00f700 || c.g < 0x00f700 || c.b < 0x00f700)) 810 && (c.r < 0x00f700 || c.g < 0x00f700 || c.b < 0x00f700))
755 { 811 {
756 flags |= bgPixmap_t::tintNeeded; 812 flags |= bgPixmap_t::tintNeeded;
757 } 813 }
758 } 814 }
759 815
760 if (flags & bgPixmap_t::tintNeeded) 816 if (flags & bgPixmap_t::tintNeeded)
761 { 817 {
762 if (flags & bgPixmap_t::tintWholesome) 818 if (flags & bgPixmap_t::tintWholesome)
791{ 847{
792 unsigned long new_flags = compute_tint_shade_flags (NULL, shade); 848 unsigned long new_flags = compute_tint_shade_flags (NULL, shade);
793 849
794 if (new_flags != (flags & tintFlags)) 850 if (new_flags != (flags & tintFlags))
795 { 851 {
796 flags = (flags&~tintFlags)|new_flags; 852 flags = (flags & ~tintFlags) | new_flags;
797 return true; 853 return true;
798 } 854 }
799 855
800 return false; 856 return false;
801} 857}
802 858
832 unsigned long result = 0; 888 unsigned long result = 0;
833 889
834 if (target == NULL) 890 if (target == NULL)
835 return 0; 891 return 0;
836 892
837 /* root dimentions may change from call to call - but Display structure should 893 /* root dimensions may change from call to call - but Display structure should
838 * be always up-to-date, so let's use it : 894 * be always up-to-date, so let's use it :
839 */ 895 */
840 Window root = target->display->root; 896 Window root = target->display->root;
841 int screen = target->display->screen; 897 int screen = target->display->screen;
842 Display *dpy = target->dpy; 898 Display *dpy = target->dpy;
887 943
888 attr.background_pixmap = ParentRelative; 944 attr.background_pixmap = ParentRelative;
889 attr.backing_store = Always; 945 attr.backing_store = Always;
890 attr.event_mask = ExposureMask; 946 attr.event_mask = ExposureMask;
891 attr.override_redirect = True; 947 attr.override_redirect = True;
892 src = XCreateWindow (dpy, root, sx, sy, window_width, window_height, 0, 948 src = XCreateWindow (dpy, root, sx, sy, window_width, window_height, 0,
893 CopyFromParent, CopyFromParent, CopyFromParent, 949 CopyFromParent, CopyFromParent, CopyFromParent,
894 CWBackPixmap|CWBackingStore|CWOverrideRedirect|CWEventMask, 950 CWBackPixmap|CWBackingStore|CWOverrideRedirect|CWEventMask,
895 &attr); 951 &attr);
896 952
897 if (src != None) 953 if (src != None)
921 XDestroyWindow (dpy, src); 977 XDestroyWindow (dpy, src);
922 XUngrabServer (dpy); 978 XUngrabServer (dpy);
923 //fprintf (stderr, "%s:%d: ev_count = %d\n", __FUNCTION__, __LINE__, ev_count); 979 //fprintf (stderr, "%s:%d: ev_count = %d\n", __FUNCTION__, __LINE__, ev_count);
924 } 980 }
925 981
926 if (!success) 982 if (!success)
927 { 983 {
928 XFreePixmap (dpy, tiled_root_pmap); 984 XFreePixmap (dpy, tiled_root_pmap);
929 tiled_root_pmap = None; 985 tiled_root_pmap = None;
930 } 986 }
931 else 987 else
932 result |= transpPmapTiled; 988 result |= transpPmapTiled;
933 } 989 }
934 else 990 else
935 { 991 {
936 /* strightforward pixmap copy */ 992 /* straightforward pixmap copy */
937 gcv.tile = root_pixmap; 993 gcv.tile = root_pixmap;
938 gcv.fill_style = FillTiled; 994 gcv.fill_style = FillTiled;
939 995
940 while (sx < 0) sx += (int)root_width; 996 while (sx < 0) sx += (int)root_width;
941 while (sy < 0) sy += (int)root_height; 997 while (sy < 0) sy += (int)root_height;
1054# if DO_TIMING_TEST 1110# if DO_TIMING_TEST
1055 XSync (dpy, False); 1111 XSync (dpy, False);
1056# endif 1112# endif
1057# endif 1113# endif
1058 } 1114 }
1059 } 1115 }
1060 } /* server side rendering completed */ 1116 } /* server side rendering completed */
1061 1117
1062 if (pixmap) 1118 if (pixmap)
1063 XFreePixmap (dpy, pixmap); 1119 XFreePixmap (dpy, pixmap);
1064 1120
1092 return false; 1148 return false;
1093} 1149}
1094# endif /* ENABLE_TRANSPARENCY */ 1150# endif /* ENABLE_TRANSPARENCY */
1095 1151
1096# ifndef HAVE_AFTERIMAGE 1152# ifndef HAVE_AFTERIMAGE
1097static void ShadeXImage(rxvt_term *term, XImage* srcImage, int shade, int rm, int gm, int bm); 1153static void ShadeXImage(rxvt_term *term, XImage *srcImage, int shade, int rm, int gm, int bm);
1098# endif 1154# endif
1099 1155
1100bool 1156bool
1101bgPixmap_t::render () 1157bgPixmap_t::render ()
1102{ 1158{
1105 if (target == NULL) 1161 if (target == NULL)
1106 return false; 1162 return false;
1107 1163
1108 TIMING_TEST_START (tp); 1164 TIMING_TEST_START (tp);
1109 1165
1110 invalidate(); 1166 invalidate ();
1111# ifdef ENABLE_TRANSPARENCY 1167# ifdef ENABLE_TRANSPARENCY
1112 if (flags & isTransparent) 1168 if (flags & isTransparent)
1113 { 1169 {
1114 /* we need to re-generate transparency pixmap in that case ! */ 1170 /* we need to re-generate transparency pixmap in that case ! */
1115 background_flags = make_transparency_pixmap (); 1171 background_flags = make_transparency_pixmap ();
1116 if (background_flags == 0) 1172 if (background_flags == 0)
1117 return false; 1173 return false;
1118 else if ((background_flags & transpTransformations) == (flags & transpTransformations) 1174 else if ((background_flags & transpTransformations) == (flags & transpTransformations)
1119 && pmap_depth == target->depth) 1175 && pmap_depth == target->depth)
1120 flags = flags & ~isInvalid; 1176 flags = flags & ~isInvalid;
1121 } 1177 }
1122# endif 1178# endif
1123 1179
1180# ifdef BG_IMAGE_FROM_FILE
1181 if (have_image
1182 || (background_flags & transpTransformations) != (flags & transpTransformations))
1183 {
1184 if (render_image (background_flags))
1185 flags = flags & ~isInvalid;
1186 }
1187# endif
1188
1124 XImage *result = NULL; 1189 XImage *result = NULL;
1125# ifdef HAVE_AFTERIMAGE
1126 if (original_asim
1127 || (background_flags & transpTransformations) != (flags & transpTransformations))
1128 {
1129 ASImage *background = NULL;
1130 ARGB32 as_tint = TINT_LEAVE_SAME;
1131 if (background_flags)
1132 background = pixmap2ximage (target->asv, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, 100);
1133 1190
1134# ifdef ENABLE_TRANSPARENCY 1191 if (background_flags && (flags & isInvalid))
1135 if (!(background_flags & transpPmapTinted) && (flags & tintNeeded))
1136 {
1137 ShadingInfo as_shade;
1138 as_shade.shading = (shade == 0) ? 100 : shade;
1139
1140 rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC);
1141 if (flags & tintSet)
1142 tint.get (c);
1143 as_shade.tintColor.red = c.r;
1144 as_shade.tintColor.green = c.g;
1145 as_shade.tintColor.blue = c.b;
1146
1147 as_tint = shading2tint32 (&as_shade);
1148 }
1149 if (!(background_flags & transpPmapBlured) && (flags & blurNeeded) && background != NULL)
1150 {
1151 ASImage* tmp = blur_asimage_gauss (target->asv, background, h_blurRadius, v_blurRadius, 0xFFFFFFFF,
1152 (original_asim == NULL || tint == TINT_LEAVE_SAME)?ASA_XImage:ASA_ASImage,
1153 100, ASIMAGE_QUALITY_DEFAULT);
1154 if (tmp)
1155 {
1156 destroy_asimage (&background);
1157 background = tmp;
1158 }
1159 }
1160# endif
1161
1162 if (render_asim (background, as_tint))
1163 flags = flags & ~isInvalid;
1164 if (background)
1165 destroy_asimage (&background);
1166 }
1167 else if (background_flags && pmap_depth != target->depth)
1168 { 1192 {
1169 result = XGetImage (target->dpy, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, ZPixmap); 1193 result = XGetImage (target->dpy, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, ZPixmap);
1170 }
1171 1194
1195# if !defined(HAVE_AFTERIMAGE) && !XFT
1172# elif !XFT /* our own client-side tinting */ 1196 /* our own client-side tinting */
1173
1174 /* ATTENTION: We ASSUME that XFT will let us do all the tinting neccessary server-side. 1197 /* ATTENTION: We ASSUME that XFT will let us do all the tinting necessary server-side.
1175 This may need to be changed in need_client_side_rendering() logic is altered !!! */ 1198 This may need to be changed in need_client_side_rendering() logic is altered !!! */
1176
1177 if (background_flags && (flags & isInvalid))
1178 {
1179 result = XGetImage (target->dpy, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, ZPixmap);
1180 if (result != NULL && !(background_flags & transpPmapTinted) && (flags & tintNeeded)) 1199 if (result != NULL && !(background_flags & transpPmapTinted) && (flags & tintNeeded))
1181 { 1200 {
1182 rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC); 1201 rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC);
1183 if (flags & tintSet) 1202 if (flags & tintSet)
1184 tint.get (c); 1203 tint.get (c);
1185 ShadeXImage (target, result, shade, c.r, c.g, c.b); 1204 ShadeXImage (target, result, shade, c.r, c.g, c.b);
1186 } 1205 }
1206# endif
1187 } 1207 }
1188# endif /* HAVE_AFTERIMAGE */
1189 1208
1190 if (result) 1209 if (result)
1191 { 1210 {
1192 GC gc = XCreateGC (target->dpy, target->vt, 0UL, NULL); 1211 GC gc = XCreateGC (target->dpy, target->vt, 0UL, NULL);
1193 1212
1225 1244
1226 XFreeGC (target->dpy, gc); 1245 XFreeGC (target->dpy, gc);
1227 flags = flags & ~isInvalid; 1246 flags = flags & ~isInvalid;
1228 } 1247 }
1229 1248
1230 XDestroyImage (result); 1249 XDestroyImage (result);
1231 } 1250 }
1232 1251
1233 if (flags & isInvalid) 1252 if (flags & isInvalid)
1234 { 1253 {
1235 if (pixmap != None) 1254 if (pixmap != None)
1259# ifdef ENABLE_TRANSPARENCY 1278# ifdef ENABLE_TRANSPARENCY
1260 root_depth = DefaultDepthOfScreen (ScreenOfDisplay (target->dpy, target->display->screen)); 1279 root_depth = DefaultDepthOfScreen (ScreenOfDisplay (target->dpy, target->display->screen));
1261# endif 1280# endif
1262 return true; 1281 return true;
1263 } 1282 }
1283
1264 return false; 1284 return false;
1265} 1285}
1266 1286
1267void 1287void
1268bgPixmap_t::apply () 1288bgPixmap_t::apply ()
1269{ 1289{
1270 if (target) 1290 if (target)
1271 { 1291 {
1272 flags &= ~isVtOrigin; 1292 flags &= ~isVtOrigin;
1293
1273 if (pixmap != None) 1294 if (pixmap != None)
1274 { 1295 {
1275 /* set target's background to pixmap */ 1296 /* set target's background to pixmap */
1276# ifdef ENABLE_TRANSPARENCY 1297# ifdef ENABLE_TRANSPARENCY
1277 if (flags & isTransparent) 1298 if (flags & isTransparent)
1278 { 1299 {
1279 XSetWindowBackgroundPixmap (target->dpy, target->parent[0], pixmap); 1300 XSetWindowBackgroundPixmap (target->dpy, target->parent[0], pixmap);
1280 XSetWindowBackgroundPixmap (target->dpy, target->vt, ParentRelative); 1301 XSetWindowBackgroundPixmap (target->dpy, target->vt, ParentRelative);
1281# if HAVE_SCROLLBARS 1302
1282 if (target->scrollBar.win) 1303 if (target->scrollBar.win)
1283 XSetWindowBackgroundPixmap (target->dpy, target->scrollBar.win, ParentRelative); 1304 XSetWindowBackgroundPixmap (target->dpy, target->scrollBar.win, ParentRelative);
1284# endif
1285 } 1305 }
1286 else 1306 else
1287# endif 1307# endif
1288 { 1308 {
1289 flags |= isVtOrigin; 1309 flags |= isVtOrigin;
1290 /* force old pixmap dereference in case it was transparent before :*/ 1310 /* force old pixmap dereference in case it was transparent before :*/
1291 XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]); 1311 XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]);
1292 XSetWindowBackgroundPixmap (target->dpy, target->vt, pixmap); 1312 XSetWindowBackgroundPixmap (target->dpy, target->vt, pixmap);
1293 /* do we also need to set scrollbar's background here ? */ 1313 /* do we also need to set scrollbar's background here ? */
1294# if HAVE_SCROLLBARS 1314
1295 if (target->scrollBar.win) 1315 if (target->scrollBar.win)
1296 XSetWindowBackground (target->dpy, target->scrollBar.win, target->pix_colors[Color_border]); 1316 XSetWindowBackground (target->dpy, target->scrollBar.win, target->pix_colors[Color_border]);
1297# endif
1298 } 1317 }
1299 } 1318 }
1300 else 1319 else
1301 { 1320 {
1302 /* set target background to a pixel */ 1321 /* set target background to a pixel */
1303 XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]); 1322 XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]);
1304 XSetWindowBackground (target->dpy, target->vt, target->pix_colors[Color_bg]); 1323 XSetWindowBackground (target->dpy, target->vt, target->pix_colors[Color_bg]);
1305 /* do we also need to set scrollbar's background here ? */ 1324 /* do we also need to set scrollbar's background here ? */
1306# if HAVE_SCROLLBARS
1307 if (target->scrollBar.win) 1325 if (target->scrollBar.win)
1308 XSetWindowBackground (target->dpy, target->scrollBar.win, target->pix_colors[Color_border]); 1326 XSetWindowBackground (target->dpy, target->scrollBar.win, target->pix_colors[Color_border]);
1309# endif
1310 } 1327 }
1328
1311 /* don't want Expose on the parent or vt. It is better to use 1329 /* don't want Expose on the parent or vt. It is better to use
1312 scr_touch or we get a great deal of flicker otherwise: */ 1330 scr_touch or we get a great deal of flicker otherwise: */
1313 XClearWindow (target->dpy, target->parent[0]); 1331 XClearWindow (target->dpy, target->parent[0]);
1314 1332
1315# if HAVE_SCROLLBARS 1333 if (target->scrollBar.state && target->scrollBar.win)
1316 if (target->scrollBar.win)
1317 { 1334 {
1318 target->scrollBar.setIdle (); 1335 target->scrollBar.state = STATE_IDLE;
1319 target->scrollbar_show (0); 1336 target->scrollBar.show (0);
1320 } 1337 }
1321# endif
1322 1338
1323 target->want_refresh = 1; 1339 target->want_refresh = 1;
1324 flags |= hasChanged; 1340 flags |= hasChanged;
1325 } 1341 }
1326} 1342}
1331/* taken from aterm-0.4.2 */ 1347/* taken from aterm-0.4.2 */
1332 1348
1333typedef uint32_t RUINT32T; 1349typedef uint32_t RUINT32T;
1334 1350
1335static void 1351static void
1336ShadeXImage(rxvt_term *term, XImage* srcImage, int shade, int rm, int gm, int bm) 1352ShadeXImage(rxvt_term *term, XImage *srcImage, int shade, int rm, int gm, int bm)
1337{ 1353{
1338 int sh_r, sh_g, sh_b; 1354 int sh_r, sh_g, sh_b;
1339 RUINT32T mask_r, mask_g, mask_b; 1355 RUINT32T mask_r, mask_g, mask_b;
1340 RUINT32T *lookup, *lookup_r, *lookup_g, *lookup_b; 1356 RUINT32T *lookup, *lookup_r, *lookup_g, *lookup_b;
1341 unsigned int lower_lim_r, lower_lim_g, lower_lim_b; 1357 unsigned int lower_lim_r, lower_lim_g, lower_lim_b;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines