unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Carlos Pita <carlosjosepita@gmail.com>
To: Robert Pluim <rpluim@gmail.com>
Cc: 37932@debbugs.gnu.org
Subject: bug#37932: [PATCH] Support hidpi fringes and images with Cairo
Date: Sun, 27 Oct 2019 14:08:02 -0300	[thread overview]
Message-ID: <CAELgYhfSaL6igCjj2OujFv20Y0-ApkDNzTCSouLcG5TEG0X5Dg@mail.gmail.com> (raw)
In-Reply-To: <m2a79mr429.fsf@gmail.com>

> If I read the patch correctly, you now auto-scale inside image.c,
> which shouldn't change anything when not using :scale. What's the

Right, AFAICS scaling of images was always done inside image.c, that's
where transformation routines are coded. The difference is more in the
usage of the :scale parameter. Previously there were two cases:

1. The caller doesn't pass a :scale in the spec. Then a :scale
property compensating for the dpi of the screen is automatically added
to the spec if the image-scaling-factor customization option is set to
'auto.  The computed scale factor assumes a representative character
to be 10px width.

2. The caller passes a :scale in the spec. Then the image is scaled
using this number and no extra dpi-adapting-scaling is done.

I see two shortcomings with this approach:

a. One I've already mentioned above: scaling required by the
application shouldn't interfere with scaling done to fit screen
resolution, which is a concern at a very different level.

b. Moreover, I'm not sure how compatible is this 10px char width
assumption with the 96dpi base resolution assumed to compute scale
factors in xterm.c and w32term.c. OTOH, the 96dpi assumption is
compatible with what gtk does. Anyway, with my patch each platform is
able to set a different base resolution if that's necessary.

> effect when code passes in eg :scale 2? Autoscaling + frame scaling,
> so for a frame where scale == 2 we get * 4? I guess that would be
> sensible, but weʼd need to explain it clearly. [1]

User code should be mostly unaware of the underlying resolution except
for very specialized cases. Currently, that is reflected in the
default 'auto image-scaling-factor. It's true that, as I commented in
point 1 above, nowadays one can pass a explicit :scale in order to
turn auto-scaling off, although in most cases that would probably
introduce a bug by *inadvertently* turning auto-scaling off. We can
add another property to the spec in order to enforce real pixel size,
or the user can divide the desired scale by the result of
image-compute-scaling-factor (in the same way the xterm backend is
circumventing gtk auto-scaling by applying the inverse scale operation
first). I prefer adding a new spec property to turn-off auto-scaling,
because that way both image-compute-scaling-factor and
image-scaling-factor could be removed from the codebase and also the
inconsistency between 96dpi and 10px criteria wouldn't be a problem
any more.





  reply	other threads:[~2019-10-27 17:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-26  2:17 bug#37932: [PATCH] Support hidpi fringes and images with Cairo Carlos Pita
2019-10-26  2:30 ` Carlos Pita
2019-10-26  6:01   ` Carlos Pita
2019-10-26  6:43     ` Carlos Pita
2019-10-26  8:05       ` Carlos Pita
2019-10-26  9:14         ` Eli Zaretskii
2019-10-26  9:18           ` Carlos Pita
2019-10-27  8:22           ` Robert Pluim
2019-10-27 17:08             ` Carlos Pita [this message]
2019-10-27 17:10               ` Carlos Pita
2024-01-10 22:15                 ` Stefan Kangas
2024-01-11 17:35                   ` Carlos Pita
2024-01-11 18:21                     ` Stefan Kangas
2024-01-11 18:38                       ` Carlos Pita
2024-01-11 19:31                         ` Stefan Kangas

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=CAELgYhfSaL6igCjj2OujFv20Y0-ApkDNzTCSouLcG5TEG0X5Dg@mail.gmail.com \
    --to=carlosjosepita@gmail.com \
    --cc=37932@debbugs.gnu.org \
    --cc=rpluim@gmail.com \
    /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).