summaryrefslogtreecommitdiff
path: root/src/w32term.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2020-12-12 13:12:57 +0200
committerEli Zaretskii <eliz@gnu.org>2020-12-12 13:12:57 +0200
commit61b6cc401a9adf7f718c1c9c4350181ecd413f1c (patch)
tree040ecf4857da1fa148fa0191db004a437e12f07e /src/w32term.c
parentdba74cb5ec1c1abfbee236bbcf811b023bb19d4f (diff)
downloademacs-61b6cc401a9adf7f718c1c9c4350181ecd413f1c.tar.gz
emacs-61b6cc401a9adf7f718c1c9c4350181ecd413f1c.tar.bz2
emacs-61b6cc401a9adf7f718c1c9c4350181ecd413f1c.zip
Improve support for 'memory-report' on MS-Windows
* src/w32term.c (w32_image_size): New function. * src/image.c (image_frame_cache_size) [HAVE_NTGUI]: Support reporting the size of frame image cache. (image_frame_cache_size, Fimage_cache_size): The total size is now of the type 'size_t', not 'int'.
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 23cb380040b..dc5cd1f6997 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1991,6 +1991,17 @@ w32_draw_image_foreground (struct glyph_string *s)
RestoreDC (s->hdc ,-1);
}
+size_t
+w32_image_size (struct image *img)
+{
+ BITMAP bm_info;
+ size_t rv = 0;
+
+ if (GetObject (img->pixmap, sizeof (BITMAP), &bm_info))
+ rv = bm_info.bmWidth * bm_info.bmHeight * bm_info.bmBitsPixel / 8;
+ return rv;
+}
+
/* Draw a relief around the image glyph string S. */