[poppler] Re: [PATCH] poppler-qt links
Albert Astals Cid
aacid at kde.org
Wed Sep 20 14:14:30 PDT 2006
A Dijous 07 Setembre 2006 23:10, Wilfried Huss va escriure:
> Am Thursday, 7. September 2006 11:48 schrieb Brad Hards:
> > On Thursday 07 September 2006 19:07, Wilfried Huss wrote:
> > > Hi,
> > >
> > > attached are two patches (for the qt3 and qt4 bindings) which change
> > > Page::links() in a way to make it work correctly even if the render
> > > function was not called with doLinks=true previously. The current code
> > > results in a crash in such a situation.
> >
> > I'm not sure I fully understand this code, but it looks like you are
> > recalculating the links every time.
> >
> > Have you timed this?
>
> No I havn't. With the current code, if you want to access link information,
> you also need to call renderToImage() first, which is definitely not a
> cheap operation.
It is if you want to show the page ;-)
>
> > Is it worth trying to cache it?
>
> One could try to remember if the last time renderToImage() had been called
> with doLinks=true, and then use the cached version of the link data
> structure. But I'm not sure if it is really worth it.
Could you please time the diferences in
render + getlinks that are there already
and
render + getlinks using your code
.
I agree that making the library more functional using your patch may be a good
thing, but there is no necessity in making it slower for the rest, no?
BTW if you don't have time for it, tellme and i'll test it next week at
aKademy.
>
> Any viewer application will most likely cache data itself. So I don't think
> that the usecase where Page::links() will be called so many times in a row,
> that it will make a noticable difference, will be very common.
>
> > Also, would it be possible to add a test case that shows the problem you
> > are fixing?
>
> Im mainly trying to fix the problem that it is currently impossible to use
> the Qt-bindings to access the links without first creating a pixmap that
> has the link rectangles drawn into it.
>
> kviewshell draws links itself, in order to make the look consistent for all
> supported fileformats, and to make things like mouseover effects possible.
> Therefore I don't want to have link rectangles painted into the rendered
> pixmaps.
Seems a good enough use case once the speed issue is clarified.
Albert
>
> Greetings,
> Wilfried.
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
More information about the poppler
mailing list