From: Donal K. Fellows on
Alexandre Ferrieux wrote:
> Question to the designer (Donal?):

I'm the maintainer, not the designer. Alas, I've been busy with other
things (e.g. Tcl) for the past few years...

> couldn't we arrange so that this
> region be recomputed in a lazier fashion instead of after each and
> every [img put] ? I understand that it may be needed in the very next
> [put], but only if the source pixels have any transparency; maybe
> there's room for optimizing the interesting special case of no-
> transparency-in-source ?

Theoretically, yes. It's just not yet been done. I suggest adding some
code to recalculate the clip region when Tk becomes idle, but
canceling the event and doing it immediately if something demands the
region before then; you'll probably want to centralize the code to get
the region into a single function, but that should be easy enough. It
should be possible to keep the code to do this entirely within
tkImgPhoto.c.

Donal.
From: Alexandre Ferrieux on
On Jul 5, 4:41 pm, "Donal K. Fellows" <donal.k.fell...(a)man.ac.uk>
wrote:
>
> I suggest adding some
> code to recalculate the clip region when Tk becomes idle, but
> canceling the event and doing it immediately if something demands the
> region before then;

Instead, what about just marking it as "dirty", and letting it be
recomputed only next time it is needed ?
(Oh, maybe that's because this region is used to define the clickable
part of an image item in a canvas, hence we don't want that extra
computation at click time... is this what you had in mind to justify
recompute-when-idle ?)

-Alex
From: Donal K. Fellows on
Alexandre Ferrieux wrote:
> Instead, what about just marking it as "dirty", and letting it be
> recomputed only next time it is needed ?
> (Oh, maybe that's because this region is used to define the clickable
> part of an image item in a canvas, hence we don't want that extra
> computation at click time... is this what you had in mind to justify
> recompute-when-idle ?)

I don't recall the details, but doing it on idle (except when it is
needed *right now*) should be good enough. Tk does lots of expensive
stuff on idle; I suppose it is The Tk Way. :-)

Donal.