giddie / poppler-cairo-backend

A patchset to enable subpixel rendering of fonts via Cairo in Poppler's Qt wrapper
18 stars 2 forks source link

Cairo backend does not rerender the page when zooming in in okular #1

Closed hephooey closed 10 years ago

hephooey commented 10 years ago

Click the zoom in button a few time, the page starts to look ungly, the image looks like a smaller pixmap scaled up to the new resolution, rather than rendered directly under the new resolution

giddie commented 10 years ago

Are you sure this doesn't happen with the original Splash backend? If so, this would indicate that it's something to do with the PDF or Okular.

If you don't see the same issue with Splash, could you check that it also doesn't happen with Evince (e.g. in Ubuntu), which uses Cairo too? This would indicate that it's something to do with the Cairo backend, and should be reported upstream to Poppler (mentioning the problem in Evince).

If neither of those have the same issue, could you make the PDF available somewhere so that I can try to reproduce the issue?

giddie commented 10 years ago

OK, I'm seeing this too. The Splash backend doesn't suffer from this. I'm not sure what the cause is, and I sadly don't have a lot of time to devote to it.

giddie commented 10 years ago

In a test document, I find that if I zoom to 398% and reload the PDF, it is drawn correctly, but if I do the same at 399%, the document does not draw, and I get only white. It seems that Cairo is refusing to draw beyond a certain resolution, and Okular is simply scaling the old image up instead.

giddie commented 10 years ago

Well whadaya know I found the issue. This was caused by Okular's relatively recent tiling behaviour, which kicks in at higher zoom levels. Instead of rendering the whole page, Okular starts requesting smaller tiles, and my code was partially ignoring that, returning an image that was the wrong size. Okular rejected the image, and so only a scaled-up version of the last correctly-rendered image could be seen. This has now been fixed :)