emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Add native image scaling


From: Eli Zaretskii
Subject: Re: [PATCH] Add native image scaling
Date: Wed, 02 Jan 2019 18:11:42 +0200

> Date: Tue, 1 Jan 2019 21:47:19 +0000
> From: Alan Third <address@hidden>
> Cc: address@hidden
> 
> 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!



reply via email to

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