Cache is discarded on zoom
Bug #1330779 reported by
Martin Spacek
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qpdfview |
Fix Released
|
Wishlist
|
Martin Spacek |
Bug Description
Currently, it seems the cache is only used for panning at a given zoom level. Zooming in our out seems to clear the cache and start all over. I'll have a look to see if this is a relatively easy fix. Seems the place for this might be tileitem.cpp
Related branches
lp:~mspacek/qpdfview/cachezoom
- Adam Reichold: Approve
-
Diff: 208 lines (+53/-16)4 files modifiedsources/pageitem.cpp (+11/-4)
sources/pageitem.h (+1/-1)
sources/tileitem.cpp (+36/-10)
sources/tileitem.h (+5/-1)
Changed in qpdfview: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |
Changed in qpdfview: | |
assignee: | nobody → Martin Spacek (mspacek) |
status: | Triaged → In Progress |
Changed in qpdfview: | |
status: | In Progress → Fix Committed |
milestone: | none → 0.4.12 |
Changed in qpdfview: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Yes, caching of pixmap is done in the TileItem class. In principle, it should be straight forward to key the cache not just on the TileItem but additionally on the rendering parameter. (I would suggest defining a struct with a comparison operator in the global header for that.)
Be aware though that you will sometimes need to completely invalidate the cache, i.e. remove all entries for a given TileItem instance for all rendering parameters, e.g. when an annotation was added or the contents of a form field changed or the TileItem instance is destoryed. This might necessitate enumerating the whole cache or rolling your own data structure and exposing upperBound and lowerBound methods like in QMap.