D9328: Add support for cancellable image rendering and text extraction

Albert Astals Cid noreply at phabricator.kde.org
Mon Jan 29 15:05:49 UTC 2018


aacid added a comment.


  In https://phabricator.kde.org/D9328#196555, @rkflx wrote:
  
  > >> 5. `ASSERT: "page()" in file okular/core/generator_p.cpp, line 129` (Happened two times already, but not everytime.)
  > > 
  > > You got this one changing the size of the sidebar?
  >
  > In fact, scrolling in almost every multipage document triggers the problem, which is quite serious. This was not there before (I checked specifically by only undoing the Okular patch).
  
  
  Ok, i found how to reproduce too and this should be fixed now.
  
  > 
  > 
  >  ---
  > 
  >>> 6. Text page generation not cancellable
  >> 
  >> cancel text extraction on document close
  > 
  > I'm still not sure whether it's not working correctly or I'm not understanding what "cancelling" means. In the following video, I Close during rendering (immediate reaction) and then I Close during text extraction (long delay):
  > 
  > F5676037: close-not-cancelling.webm <https://phabricator.kde.org/F5676037>
  
  Right, i did some more testing and sometimes  it doesn't cancel "as interactively" as you'd want, the problem is in two areas:
  
  - Checking "should i cancel" too often will make it slower
  - If the code is not written in a way to exit early you'll end up with memory leaks
  
  I tried adding some more "should i cancel" to the poppler patch, and ended up with the second problem.
  
  To simplify a bit text extraction is two things, "drawing" the text and then rearranging it in something that makes sense as sentences.
  
  The "drawing" part is cancellable since it shares code with the actual drawing, but the rearranging doesn't really have support for it, and i've played with it a bit and it's not immediately obvious how to make it exit early without leaking. So I would really prefer if we would delay this as a future improvement.
  
  > To me this looks like text extraction in just one huge uninterruptible chunk, and only after it has finished Okular will react with whatever I wanted to do (in this case Close). The same happens for Zoom In, where text extraction is not "stopped" and thus I get to see the pixelated rendering for quite a while (I did not test any other actions yet):
  > 
  > F5676039: zoom-not-cancelling.webm <https://phabricator.kde.org/F5676039>
  
  This is "as designed", basically at that point the pixmap has been generated, the text is being generated and now we get a new pixmap request, but you already have "something to see" so in that case i decided to not cancel the text generation.

REPOSITORY
  R223 Okular

REVISION DETAIL
  https://phabricator.kde.org/D9328

To: aacid, ervin, rkflx
Cc: rkflx, ervin, michaelweghorn, ngraham, #okular, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20180129/fb8b1244/attachment-0001.html>


More information about the Okular-devel mailing list