Bug 209632 - Instant previews by fast-scaling previous rendering
Summary: Instant previews by fast-scaling previous rendering
Status: RESOLVED NOT A BUG
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 209630 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-10-06 14:31 UTC by Benoît Jacob
Modified: 2009-10-06 22:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benoît Jacob 2009-10-06 14:31:07 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

Note: this wish includes a proposal to scratch-my-own-itch if you'll just tell me where to start.

A useful "cheat" to give the user a great speed impression, is that as soon
as he has changed the zoom level, you display an instant preview by just
fast-scaling the existing image (the currently displayed page). This doesn't take
any significant time and has a surprising effect on the user experience. The
user is willing to forgive the poor quality of the preview because he
knows it's temporary and he doesn't have time to look at it carefully anyway.
That is also useful as it allows to know right away where the text will appear
(useful at high zoom level).

I implemented that in the Mandelbrot wallpaper plugin, as you can check. The
code (very generic actually) is there:

http://websvn.kde.org/trunk/KDE/kdeplasma-addons/wallpapers/mandelbrot/mandelbrot.cpp?view=markup

See the zoomView() method.

If you want, and if you can show me where and how I plug that into Okular, I
volunteer to implement that.
Comment 1 Benoît Jacob 2009-10-06 14:32:40 UTC
I posted points 2) and 3) as issues #209630 and #209632.
Comment 2 Albert Astals Cid 2009-10-06 19:12:56 UTC
We already do that (reuse old pixmap until new one arrives), if it's not happening it's either
  a) a bug
  b) the old pixmap got kicked by the memory cache algorithm
Feel free to investigate further
Comment 3 Albert Astals Cid 2009-10-06 19:15:17 UTC
*** Bug 209630 has been marked as a duplicate of this bug. ***
Comment 4 Benoît Jacob 2009-10-06 19:44:58 UTC
I'm a bit puzzled that you say that you're already doing that. If that's the case, then when I click "zoom in" I should see an instant preview. But in practice, especially at high zoom levels, there can be 1 second between the time when i release the mouse button and the first appearance of any results. Either I'm hitting a bug, or we're not talking about the same thing at all.
Comment 5 Benoît Jacob 2009-10-06 19:46:34 UTC
Ah wait, you say "We already do that (reuse old pixmap until new one arrives)", that I don't question at all. What I'm proposing here is a bit different: not only reuse, but _scale_ the old pixmap (huh. perhaps it'd be more efficient if that was an image instead of a pixmap).
Comment 6 Pino Toscano 2009-10-06 19:53:17 UTC
> not only reuse, but _scale_ the old pixmap

Done already since ages.
Comment 7 Benoît Jacob 2009-10-06 20:04:30 UTC
(In reply to comment #6)
> > not only reuse, but _scale_ the old pixmap
> 
> Done already since ages.

I can actually see this (I was formerly incorrectly assuming that it was a new low-res rendering).

BUT it is not happening instantly. When I press "Zoom In" and release, the preview certainly doesn't appear instantly. I'll try to have a look at the code! I'm pretty sure that this is a bug.
Comment 8 Benoît Jacob 2009-10-06 22:52:21 UTC
OK, Indeed you did this "instant previews" already! But the problem is that they are not actually "instant" because there's this big latency before the slotZoomIn() is even called, see this other new bug:
https://bugs.kde.org/show_bug.cgi?id=209680

Anyway, closing this one as invalid.