unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: "Jan Djärv" <jan.h.d@swipnet.se>
Cc: Lars Magne Ingebrigtsen <larsi@gnus.org>,
	Eli Zaretskii <eliz@gnu.org>,
	emacs-devel@gnu.org
Subject: Re: image-size
Date: Fri, 21 Jun 2013 09:46:04 +0900	[thread overview]
Message-ID: <wl7ghouw8j.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <2D9A8A78-829E-4AEC-BA3E-9409A1457053@swipnet.se>

>>>>> On Thu, 20 Jun 2013 23:42:28 +0200, Jan Djärv <jan.h.d@swipnet.se> 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
				mituharu@math.s.chiba-u.ac.jp



  reply	other threads:[~2013-06-21  0:46 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20 10:04 image-size Lars Magne Ingebrigtsen
2013-06-20 12:18 ` image-size Lars Magne Ingebrigtsen
2013-06-20 16:52   ` image-size Eli Zaretskii
2013-06-20 16:01 ` image-size Eli Zaretskii
2013-06-20 16:50   ` image-size Lars Magne Ingebrigtsen
2013-06-20 16:55     ` image-size Lars Magne Ingebrigtsen
2013-06-20 17:16       ` image-size Eli Zaretskii
2013-06-20 17:54         ` image-size Lars Magne Ingebrigtsen
2013-06-20 18:15           ` image-size Eli Zaretskii
2013-06-20 18:31             ` image-size Eli Zaretskii
2013-06-20 18:46               ` image-size Lars Magne Ingebrigtsen
2013-06-20 19:11                 ` image-size Eli Zaretskii
2013-06-20 19:18                   ` image-size Lars Magne Ingebrigtsen
2013-06-20 19:37                     ` image-size Eli Zaretskii
2013-06-20 19:52                       ` image-size David Engster
2013-06-20 20:50                         ` image-size Eli Zaretskii
2013-06-20 19:34                   ` image-size Lars Magne Ingebrigtsen
2013-06-20 19:42                     ` image-size Eli Zaretskii
2013-06-20 19:52                       ` image-size Lars Magne Ingebrigtsen
2013-06-20 20:53                         ` image-size Eli Zaretskii
2013-06-20 20:57                           ` image-size Lars Magne Ingebrigtsen
2013-06-20 21:06                             ` image-size Lars Magne Ingebrigtsen
2013-06-21  6:12                               ` image-size Eli Zaretskii
2013-06-20 21:42                             ` image-size Jan Djärv
2013-06-21  0:46                               ` YAMAMOTO Mitsuharu [this message]
2013-06-21  6:27                                 ` image-size Lars Magne Ingebrigtsen
2013-06-26  8:25                                   ` image-size YAMAMOTO Mitsuharu
2013-06-26 10:39                                     ` image-size YAMAMOTO Mitsuharu
2013-06-26 12:04                                     ` image-size Lars Magne Ingebrigtsen
2013-06-27  0:46                                       ` image-size Lars Magne Ingebrigtsen
2013-06-27  2:49                                         ` image-size Stefan Monnier
2013-06-28  2:46                                       ` image-size YAMAMOTO Mitsuharu
2013-06-28  3:12                                         ` image-size Juanma Barranquero
2013-06-28  3:45                                           ` image-size YAMAMOTO Mitsuharu
2013-06-21  6:15                               ` image-size Eli Zaretskii
2013-06-21  7:34                                 ` image-size Jan Djärv
2013-06-21  8:27                                   ` image-size Eli Zaretskii
2013-06-21  9:03                                     ` image-size Jan Djärv
2013-06-21  9:07                                       ` image-size Lars Magne Ingebrigtsen
2013-06-21  9:58                                         ` image-size Eli Zaretskii
2013-06-21  9:57                                       ` image-size Eli Zaretskii
2013-06-21  6:13                             ` image-size Eli Zaretskii
2013-06-21 15:54                               ` image-size Willem Rein Oudshoorn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wl7ghouw8j.wl%mituharu@math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jan.h.d@swipnet.se \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).