From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add native image scaling Date: Wed, 02 Jan 2019 18:11:42 +0200 Message-ID: <8336qb3upt.fsf@gnu.org> References: <20181230124759.GA77761@breton.holly.idiocy.org> <20190101214719.GA18292@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1546445400 20819 195.159.176.226 (2 Jan 2019 16:10:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 2 Jan 2019 16:10:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 02 17:09:56 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gej5e-0005FK-9h for ged-emacs-devel@m.gmane.org; Wed, 02 Jan 2019 17:09:54 +0100 Original-Received: from localhost ([127.0.0.1]:45865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gej7k-0002ZW-MV for ged-emacs-devel@m.gmane.org; Wed, 02 Jan 2019 11:12:04 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gej7b-0002ZO-JE for emacs-devel@gnu.org; Wed, 02 Jan 2019 11:11:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gej7V-0008Aw-TA for emacs-devel@gnu.org; Wed, 02 Jan 2019 11:11:55 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gej7U-0008AO-TD; Wed, 02 Jan 2019 11:11:49 -0500 Original-Received: from [176.228.60.248] (port=3082 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gej7U-0006ez-Gt; Wed, 02 Jan 2019 11:11:48 -0500 In-reply-to: <20190101214719.GA18292@breton.holly.idiocy.org> (message from Alan Third on Tue, 1 Jan 2019 21:47:19 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232091 Archived-At: > Date: Tue, 1 Jan 2019 21:47:19 +0000 > From: Alan Third > Cc: emacs-devel@gnu.org > > This is a completely rewritten version that doesn't do anything > different with the image cache. I think this is pretty complete as it > is, excepting Windows support. I don't know how to add Windows support > to match the way it's done in NS and X, however if we can't resize the > images up-front, it should be possible to add some size info to the > image struct and do the resize on display. Thanks, I have only minor comments, after which this can be pushed. Support for MS-Windows can be added later. > +#ifdef HAVE_XRENDER > +static bool x_create_x_image_and_pixmap (struct frame *, int, int, int, > + XImagePtr *, Pixmap *, Picture *); > +#else > static bool x_create_x_image_and_pixmap (struct frame *, int, int, int, > XImagePtr *, Pixmap *); > +#endif > static void x_destroy_x_image (XImagePtr ximg); Here and elsewhere, I'd prefer not to change the signature of functions with and without the scaling support. Instead, let's use the same signature, where the extra argument(s) are left unused when scaling is not supported. If some data types will be undefined without including headers which are available only when the feature is supported, we can either use a void pointer, or have a dummy data type definition for those arguments. > +DEFUN ("image-scaling-p", Fimage_scaling_p, Simage_scaling_p, 0, 1, 0, > + doc: /* Test whether FRAME supports resizing images. > +Return t if FRAME supports native scaling, nil otherwise. */) > + (Lisp_Object frame) This primitive should be documented both in NEWS and in the ELisp manual. Thanks!