emacs-devel
[Top][All Lists]
Advanced

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

Re: GDI+ take 3


From: Juan José García-Ripoll
Subject: Re: GDI+ take 3
Date: Tue, 21 Apr 2020 18:20:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt)

Eli Zaretskii <address@hidden> writes:
>> - Something wants to load an image and invokes lookup_image_type()
>> - lookup_image_type() calls image_can_use_native_api
>>   + within image_can_use_native_api, the type of image is verified
>>      - if it is right, it _initializes_ gdi+ (= init method)
>>      - otherwise returns false
>>   + when image_can_use_native_api returns false, lookup_image_type
>>      loops over image type
>>      - for each image type it calls initialize_image_type()
>>        * initialize_image_type aclls image_can_use_native_api again!
>>        * it then invokes the initialization method
>> 
>> So, in the current architecture, image_can_use_native_api() is called
>> redundantly.
>
> Yes, but it's very fast.  And also, is the above flow the only one?
> Can we ever call initialize_image_type directly?

No. It is a static function and it is only called from lookup_image_type()

> I think we may be miscommunicating.  If Emacs is built without
> librsvg, the HAVE_RSVG macro is not defined, and the SVG part of the
> image_types[] array and init_svg_functions are not compiled into
> Emacs.  So there's no initialization method to call for SVG images,
> and initialize_image_type should return false.

My patch only removes the call to image_can_use_native_api () from
initialize_image_type() because that function was already used in the
only function that invokes it. The output of initialize_image_type() is
not changed for other libraries.

-- 
Juan José García Ripoll
http://juanjose.garciaripoll.com
http://quinfog.hbar.es




reply via email to

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