diff options
| author | Po Lu | 2022-02-18 21:24:42 +0800 |
|---|---|---|
| committer | Po Lu | 2022-02-18 21:24:42 +0800 |
| commit | b76cd8af054a0e24ed8cd1bea515f1ca4619b115 (patch) | |
| tree | 5cebb2b6042da16721184105cd1e4d22ae3a06be /src | |
| parent | 1f755a74b7a0268aad6a55764f4ceba3ba4063ff (diff) | |
| download | emacs-b76cd8af054a0e24ed8cd1bea515f1ca4619b115.tar.gz emacs-b76cd8af054a0e24ed8cd1bea515f1ca4619b115.zip | |
Fix background stipple with `alpha_background'
* src/xterm.c (x_fill_rectangle): Fix treatment of foreground
and background colors when there is a stipple.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/xterm.c b/src/xterm.c index 930d9cf370c..53cb7a2ac45 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -1417,7 +1417,6 @@ x_fill_rectangle (struct frame *f, GC gc, int x, int y, int width, int height, | |||
| 1417 | #endif | 1417 | #endif |
| 1418 | 1418 | ||
| 1419 | x_xr_apply_ext_clip (f, gc); | 1419 | x_xr_apply_ext_clip (f, gc); |
| 1420 | x_xrender_color_from_gc_foreground (f, gc, &xc, true); | ||
| 1421 | 1420 | ||
| 1422 | #if RENDER_MAJOR > 0 || (RENDER_MINOR >= 10) | 1421 | #if RENDER_MAJOR > 0 || (RENDER_MINOR >= 10) |
| 1423 | XGetGCValues (FRAME_X_DISPLAY (f), | 1422 | XGetGCValues (FRAME_X_DISPLAY (f), |
| @@ -1426,15 +1425,9 @@ x_fill_rectangle (struct frame *f, GC gc, int x, int y, int width, int height, | |||
| 1426 | if (xgcv.fill_style == FillOpaqueStippled | 1425 | if (xgcv.fill_style == FillOpaqueStippled |
| 1427 | && FRAME_CHECK_XR_VERSION (f, 0, 10)) | 1426 | && FRAME_CHECK_XR_VERSION (f, 0, 10)) |
| 1428 | { | 1427 | { |
| 1429 | alpha.red = 65535 * f->alpha_background; | 1428 | x_xrender_color_from_gc_background (f, gc, &alpha, true); |
| 1430 | alpha.green = 65535 * f->alpha_background; | 1429 | x_xrender_color_from_gc_foreground (f, gc, &xc, true); |
| 1431 | alpha.blue = 65535 * f->alpha_background; | ||
| 1432 | alpha.alpha = 65535 * f->alpha_background; | ||
| 1433 | |||
| 1434 | fill = XRenderCreateSolidFill (FRAME_X_DISPLAY (f), | ||
| 1435 | &alpha); | ||
| 1436 | attrs.repeat = RepeatNormal; | 1430 | attrs.repeat = RepeatNormal; |
| 1437 | attrs.alpha_map = fill; | ||
| 1438 | 1431 | ||
| 1439 | stipple = XRenderCreatePicture (FRAME_X_DISPLAY (f), | 1432 | stipple = XRenderCreatePicture (FRAME_X_DISPLAY (f), |
| 1440 | xgcv.stipple, | 1433 | xgcv.stipple, |
| @@ -1442,19 +1435,26 @@ x_fill_rectangle (struct frame *f, GC gc, int x, int y, int width, int height, | |||
| 1442 | PictStandardA1), | 1435 | PictStandardA1), |
| 1443 | CPRepeat, &attrs); | 1436 | CPRepeat, &attrs); |
| 1444 | 1437 | ||
| 1445 | XRenderComposite (FRAME_X_DISPLAY (f), | 1438 | XRenderFillRectangle (FRAME_X_DISPLAY (f), PictOpSrc, |
| 1446 | PictOpSrc, stipple, | 1439 | FRAME_X_PICTURE (f), |
| 1447 | None, FRAME_X_PICTURE (f), | 1440 | &alpha, x, y, width, height); |
| 1448 | x, y, 0, 0, x, y, width, height); | 1441 | |
| 1442 | fill = XRenderCreateSolidFill (FRAME_X_DISPLAY (f), &xc); | ||
| 1443 | |||
| 1444 | XRenderComposite (FRAME_X_DISPLAY (f), PictOpOver, fill, stipple, | ||
| 1445 | FRAME_X_PICTURE (f), 0, 0, x, y, x, y, width, height); | ||
| 1449 | 1446 | ||
| 1450 | XRenderFreePicture (FRAME_X_DISPLAY (f), stipple); | 1447 | XRenderFreePicture (FRAME_X_DISPLAY (f), stipple); |
| 1451 | XRenderFreePicture (FRAME_X_DISPLAY (f), fill); | 1448 | XRenderFreePicture (FRAME_X_DISPLAY (f), fill); |
| 1452 | } | 1449 | } |
| 1453 | else | 1450 | else |
| 1454 | #endif | 1451 | #endif |
| 1455 | XRenderFillRectangle (FRAME_X_DISPLAY (f), | 1452 | { |
| 1456 | PictOpSrc, FRAME_X_PICTURE (f), | 1453 | x_xrender_color_from_gc_foreground (f, gc, &xc, true); |
| 1457 | &xc, x, y, width, height); | 1454 | XRenderFillRectangle (FRAME_X_DISPLAY (f), |
| 1455 | PictOpSrc, FRAME_X_PICTURE (f), | ||
| 1456 | &xc, x, y, width, height); | ||
| 1457 | } | ||
| 1458 | x_xr_reset_ext_clip (f); | 1458 | x_xr_reset_ext_clip (f); |
| 1459 | x_mark_frame_dirty (f); | 1459 | x_mark_frame_dirty (f); |
| 1460 | 1460 | ||