diff options
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/image.c b/src/image.c index 8d9c33de12c..bcc0fcd78a3 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -1041,7 +1041,7 @@ void | |||
| 1041 | prepare_image_for_display (struct frame *f, struct image *img) | 1041 | prepare_image_for_display (struct frame *f, struct image *img) |
| 1042 | { | 1042 | { |
| 1043 | /* We're about to display IMG, so set its timestamp to `now'. */ | 1043 | /* We're about to display IMG, so set its timestamp to `now'. */ |
| 1044 | img->timestamp = current_emacs_time (); | 1044 | img->timestamp = current_timespec (); |
| 1045 | 1045 | ||
| 1046 | /* If IMG doesn't have a pixmap yet, load it now, using the image | 1046 | /* If IMG doesn't have a pixmap yet, load it now, using the image |
| 1047 | type dependent loader function. */ | 1047 | type dependent loader function. */ |
| @@ -1480,7 +1480,7 @@ clear_image_cache (struct frame *f, Lisp_Object filter) | |||
| 1480 | else if (INTEGERP (Vimage_cache_eviction_delay)) | 1480 | else if (INTEGERP (Vimage_cache_eviction_delay)) |
| 1481 | { | 1481 | { |
| 1482 | /* Free cache based on timestamp. */ | 1482 | /* Free cache based on timestamp. */ |
| 1483 | EMACS_TIME old, t; | 1483 | struct timespec old, t; |
| 1484 | double delay; | 1484 | double delay; |
| 1485 | ptrdiff_t nimages = 0; | 1485 | ptrdiff_t nimages = 0; |
| 1486 | 1486 | ||
| @@ -1495,13 +1495,13 @@ clear_image_cache (struct frame *f, Lisp_Object filter) | |||
| 1495 | delay = 1600 * delay / nimages / nimages; | 1495 | delay = 1600 * delay / nimages / nimages; |
| 1496 | delay = max (delay, 1); | 1496 | delay = max (delay, 1); |
| 1497 | 1497 | ||
| 1498 | t = current_emacs_time (); | 1498 | t = current_timespec (); |
| 1499 | old = sub_emacs_time (t, EMACS_TIME_FROM_DOUBLE (delay)); | 1499 | old = timespec_sub (t, dtotimespec (delay)); |
| 1500 | 1500 | ||
| 1501 | for (i = 0; i < c->used; ++i) | 1501 | for (i = 0; i < c->used; ++i) |
| 1502 | { | 1502 | { |
| 1503 | struct image *img = c->images[i]; | 1503 | struct image *img = c->images[i]; |
| 1504 | if (img && EMACS_TIME_LT (img->timestamp, old)) | 1504 | if (img && timespec_cmp (img->timestamp, old) < 0) |
| 1505 | { | 1505 | { |
| 1506 | free_image (f, img); | 1506 | free_image (f, img); |
| 1507 | ++nfreed; | 1507 | ++nfreed; |
| @@ -1764,7 +1764,7 @@ lookup_image (struct frame *f, Lisp_Object spec) | |||
| 1764 | } | 1764 | } |
| 1765 | 1765 | ||
| 1766 | /* We're using IMG, so set its timestamp to `now'. */ | 1766 | /* We're using IMG, so set its timestamp to `now'. */ |
| 1767 | img->timestamp = current_emacs_time (); | 1767 | img->timestamp = current_timespec (); |
| 1768 | 1768 | ||
| 1769 | /* Value is the image id. */ | 1769 | /* Value is the image id. */ |
| 1770 | return img->id; | 1770 | return img->id; |
| @@ -7884,7 +7884,7 @@ struct animation_cache | |||
| 7884 | { | 7884 | { |
| 7885 | MagickWand *wand; | 7885 | MagickWand *wand; |
| 7886 | int index; | 7886 | int index; |
| 7887 | EMACS_TIME update_time; | 7887 | struct timespec update_time; |
| 7888 | struct animation_cache *next; | 7888 | struct animation_cache *next; |
| 7889 | char signature[FLEXIBLE_ARRAY_MEMBER]; | 7889 | char signature[FLEXIBLE_ARRAY_MEMBER]; |
| 7890 | }; | 7890 | }; |
| @@ -7909,13 +7909,13 @@ static void | |||
| 7909 | imagemagick_prune_animation_cache (void) | 7909 | imagemagick_prune_animation_cache (void) |
| 7910 | { | 7910 | { |
| 7911 | struct animation_cache **pcache = &animation_cache; | 7911 | struct animation_cache **pcache = &animation_cache; |
| 7912 | EMACS_TIME old = sub_emacs_time (current_emacs_time (), | 7912 | struct timespec old = timespec_sub (current_timespec (), |
| 7913 | make_emacs_time (60, 0)); | 7913 | make_timespec (60, 0)); |
| 7914 | 7914 | ||
| 7915 | while (*pcache) | 7915 | while (*pcache) |
| 7916 | { | 7916 | { |
| 7917 | struct animation_cache *cache = *pcache; | 7917 | struct animation_cache *cache = *pcache; |
| 7918 | if (EMACS_TIME_LE (old, cache->update_time)) | 7918 | if (timespec_cmp (old, cache->update_time) <= 0) |
| 7919 | pcache = &cache->next; | 7919 | pcache = &cache->next; |
| 7920 | else | 7920 | else |
| 7921 | { | 7921 | { |
| @@ -7950,7 +7950,7 @@ imagemagick_get_animation_cache (MagickWand *wand) | |||
| 7950 | } | 7950 | } |
| 7951 | 7951 | ||
| 7952 | DestroyString (signature); | 7952 | DestroyString (signature); |
| 7953 | cache->update_time = current_emacs_time (); | 7953 | cache->update_time = current_timespec (); |
| 7954 | return cache; | 7954 | return cache; |
| 7955 | } | 7955 | } |
| 7956 | 7956 | ||