From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Carlos Pita Newsgroups: gmane.emacs.bugs Subject: bug#37932: [PATCH] Support hidpi fringes and images with Cairo Date: Sat, 26 Oct 2019 05:05:52 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="57304"; mail-complaints-to="usenet@blaine.gmane.org" To: 37932@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 26 10:07:27 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iOH6c-000Ekd-4Q for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Oct 2019 10:07:26 +0200 Original-Received: from localhost ([::1]:38640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOH6b-00055D-0O for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Oct 2019 04:07:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48359) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOH6G-0004oR-1J for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2019 04:07:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iOH6E-0005aK-Sk for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2019 04:07:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59086) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iOH6E-0005aF-Pb for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2019 04:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iOH6E-00041Z-Ju for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2019 04:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Carlos Pita Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Oct 2019 08:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37932 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 37932-submit@debbugs.gnu.org id=B37932.157207717115379 (code B ref 37932); Sat, 26 Oct 2019 08:07:02 +0000 Original-Received: (at 37932) by debbugs.gnu.org; 26 Oct 2019 08:06:11 +0000 Original-Received: from localhost ([127.0.0.1]:39670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOH5P-0003zy-8k for submit@debbugs.gnu.org; Sat, 26 Oct 2019 04:06:11 -0400 Original-Received: from mail-yw1-f66.google.com ([209.85.161.66]:38685) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOH5N-0003zj-KL for 37932@debbugs.gnu.org; Sat, 26 Oct 2019 04:06:10 -0400 Original-Received: by mail-yw1-f66.google.com with SMTP id s6so1844270ywe.5 for <37932@debbugs.gnu.org>; Sat, 26 Oct 2019 01:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=EnRlxJqOBDxXlmEq6UILoH+0wOIvRe+ZY5zQkDppJCo=; b=IBFrHqS5TK23bSHTen6z9P6L3S0JstH7V8k7AbIU859bz7mVcvExAYJigW/VkIZedM jLWefxQbPjjBbM918+txFpO51+Kk4VuQ47kr7tYIiPU/B+nJ6unn3l3u/tlQRANGUB+8 JuBif9YZdAvpquhqX3Bd84ycmBrIFEXQFhclVXsIBXSvd+1HeLb/vSVBlC37lXHWjPcc eUMBgrRSmSw0Yxwn2cki6VGjhr6fd7be3bxmsMOfYKZaODFaA11TYXBm9o1lFF1Vu4or s7Tax7l3zzMHXdXRaJoNZq4pbiUoLkBqesQ+24634/VGD1FRskpPveM2Tw0T4nATDb0M Txlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=EnRlxJqOBDxXlmEq6UILoH+0wOIvRe+ZY5zQkDppJCo=; b=XfARlwBzhQTrLiQKn1s8Mvlt1NzX1Dchel4infCBynKIWWFJ3G3acLvTtXCW9le0v8 gcm+TRK4UJgeyYZ+WGlcZEPgWC78/5GyRCZVnoUMznQwNWfH+LTodSpQ1GtSIv2gkVQ1 uAPsMtmyV4DGV1LHgtW5tJQ9yrQteV8P6IBUm3qH9BwSnfbi1hBjp6fchOc0a1Hrjw1j GlVGBQjIvL0o9xojz8r8VoYane72j6tdQ3r1/8hbUpjaTx/AkcebQcLHvvW+mXNkJg+8 +shX4wJm1Vhv7awBK2cgp50w+lbbK5/QNRiv+QeltQ/GQoysGdASsvOAp8qVZMl8TUSh eCIw== X-Gm-Message-State: APjAAAUczDtKj+woIdIW7hEB08TnjNe6WeYNhBH+1zCmMX3arhWYrleY AlT1HtH9g6upxZBrmjwGdRr+9NP6cHOSEs/F9xJhJYMIiuk= X-Google-Smtp-Source: APXvYqyHh3PFR2xWb6tlUmTodXPaKJ2Ggi6UzasEXpIJXElqvAsGxwrnnScOL5o/Yhm3h6hJIfPp99vCzpYTrGZME78= X-Received: by 2002:a81:2849:: with SMTP id o70mr5529130ywo.80.1572077163619; Sat, 26 Oct 2019 01:06:03 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170180 Archived-At: Here is an attempt to fix the above issues: https://github.com/memeplex/emacs/commit/473beb25dd947c34392708ca40f1b3bf80613007 * It uses the scaling mechanism already present in image.c (notice that imagemagick does its own scaling), so it works even without cairo (except for fringes, of course). * It removes the auto :scale property. I think this is the right thing to do, applications that want to use the :scale parameter to transform their images shouldn't lose the hidpi scaling nor explicitly call image-compute-scaling-factor. * The scale factor is slightly different than the one computed by image-compute-scaling-factor, but anyway it's the scale factor that was already computed by x/w32_scale_factor. Moreover, it has separated x and y values. A bit surprisingly the patch results in a code reduction of ~20LOC. And there are image-compute-scaling-factor and image-scaling-factor still remaining in image.el. The only user inside emacs is shr.el.