emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: image-size


From: YAMAMOTO Mitsuharu
Subject: Re: image-size
Date: Fri, 21 Jun 2013 09:46:04 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Thu, 20 Jun 2013 23:42:28 +0200, Jan Djärv <address@hidden> said:

>> Of course there is no X stuff on Windows.  But if you're running
>> over X, lookup_image pushes data over X, for some reason or other.
>> I have no idea what the reason might be, but perhaps somebody else
>> does.

> lookup_image calls img->type->load, and jpeg_load creates an X
> pixmap (x_create_x_image_and_pixmap), i.e. on the X server, and
> copies the image into the pixmap, i.e. transfers it to the server
> (XPutImage).

> The functions are totally different for X, W32 and NS, so how it
> works on W32 is totally irrelevant for X and vice versa.

> Loading the image just to determine the size is a huge overhead.
> The image loading routines already know the image size before
> sending it to the server (or the equivalent for W32 and NS),
> otherwise they could not allocate the right size for the Pixmap.  No
> Imagemagic is needed to figure out the image size.

Right.  And as I mentioned in (*), a possible way to solve this
problem is to defer the creation of Pixmap (server side resource) from
XImage (client side resource) until the actual display happens (i.e.,
at prepare_image_for_display rather than lookup_image), so as to avoid
unnecessary round trip of image data between the X11 server and
client.

*: http://lists.gnu.org/archive/html/emacs-devel/2010-09/msg01285.html

On the Carbon port and its descendants, deferring the creation of
image data for display (CGImage on OS X) from the raw pixel data
(struct _XImage, a custom data structure made after X11) as above has
been done for a long time.  And I've never heard of a problem about
that.

                                     YAMAMOTO Mitsuharu
                                address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]