This fixes the bug of the page cache acting weird (e.g. the same cache index is
invalidated over and over again) after being used for some time. This is
because when we read the last-view property, we only get the least-significant
32 bits of the last_view private member.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This patch implements a page cache that is invalidated in a LRU fashion.
Pages are added to the cache as soon as they become visible. When the cache is
full and a new page that isn't in the cache becomes visible, the least recently
viewed page in the cache is evicted from memory and the new one takes it's
place.
The cache size is configurable using the page-cache-size configuration
variable, with a default value of 15 pages. Very large values for the cache
size are not recommended, though, as it will stress the system memory out.
The old periodic page reclaiming code is no longer necessary with this patch,
so I removed it.
Special thanks to Ignas Anikevičius, and Sebastian Ramacher for the
inspirations.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
If we have already requested a page to be rendered, we don't have to request it
once again.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
According to my compiler output and the page on glib deprecated APIs
[1], some of the stuff needed to be removed or changed.
[1] - http://developer.gnome.org/glib/2.31/glib-Deprecated-Thread-APIs.html
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
A rectangle whose horizontal coordinates are x1 on the left and x2 on
the right is (x2 + 1) - x1 pixels wide, not x2 - x1.
This error caused the search result highlighting to leave a
one-pixel-wide border behind, on the right and bottom side of the
result.
See issue 242 <http://bugs.pwmt.org/issue242>.
Reported-by: Abdó Roig <abdo.roig@gmail.com>
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
There was a problem passing colors to cairo_set_source_rgb.
Should be floats between 0 and 1.
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>