diff options
| author | Po Lu | 2024-04-24 16:33:33 +0800 |
|---|---|---|
| committer | Po Lu | 2024-04-24 16:33:53 +0800 |
| commit | 3776539152711ca364d94f0d4f8166d6f67eb413 (patch) | |
| tree | 69f10fba818bab02ebc91401913fe3da42b19d96 /src | |
| parent | 0e9cd1d7c6f64680c9e98a7c5c373a470088d4f9 (diff) | |
| download | emacs-3776539152711ca364d94f0d4f8166d6f67eb413.tar.gz emacs-3776539152711ca364d94f0d4f8166d6f67eb413.zip | |
Disable unsuitable XPM color selection mechanism on Android
* src/image.c (xpm_load_image) [HAVE_ANDROID]: Always select
XPM_COLOR_KEY_C.
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/image.c b/src/image.c index 74249b8d465..ab61e49f695 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -6237,6 +6237,8 @@ xpm_load_image (struct frame *f, | |||
| 6237 | expect (','); | 6237 | expect (','); |
| 6238 | 6238 | ||
| 6239 | XSETFRAME (frame, f); | 6239 | XSETFRAME (frame, f); |
| 6240 | |||
| 6241 | #ifndef HAVE_ANDROID | ||
| 6240 | if (!NILP (Fxw_display_color_p (frame))) | 6242 | if (!NILP (Fxw_display_color_p (frame))) |
| 6241 | best_key = XPM_COLOR_KEY_C; | 6243 | best_key = XPM_COLOR_KEY_C; |
| 6242 | else if (!NILP (Fx_display_grayscale_p (frame))) | 6244 | else if (!NILP (Fx_display_grayscale_p (frame))) |
| @@ -6244,6 +6246,14 @@ xpm_load_image (struct frame *f, | |||
| 6244 | ? XPM_COLOR_KEY_G : XPM_COLOR_KEY_G4); | 6246 | ? XPM_COLOR_KEY_G : XPM_COLOR_KEY_G4); |
| 6245 | else | 6247 | else |
| 6246 | best_key = XPM_COLOR_KEY_M; | 6248 | best_key = XPM_COLOR_KEY_M; |
| 6249 | #else /* HAVE_ANDROID */ | ||
| 6250 | /* The color-loading loop has not been taught to progressively settle | ||
| 6251 | for less optimal color keys if no colors are defined for best_key, | ||
| 6252 | and since libXpm is not available on Android, there is no better | ||
| 6253 | option than delegating the task of mapping whatever color values | ||
| 6254 | are provided to B/W or grayscale to the display driver. */ | ||
| 6255 | best_key = XPM_COLOR_KEY_C; | ||
| 6256 | #endif /* !HAVE_ANDROID */ | ||
| 6247 | 6257 | ||
| 6248 | color_symbols = image_spec_value (img->spec, QCcolor_symbols, NULL); | 6258 | color_symbols = image_spec_value (img->spec, QCcolor_symbols, NULL); |
| 6249 | if (chars_per_pixel == 1) | 6259 | if (chars_per_pixel == 1) |