Marwan Tanager
2013-08-08 18:23:07 UTC
Hi, Sebastian.
In commit b5237680f28d585fecf1c6d23bc7ec044e623ae1, you provide the following
check:
"if the page is not visible and not cached, but still has a surface, we need to
get rid of the surface"
Wouldn't that be redundant? I mean that if the page is not visible and not
cached, then we have two possibilities:
1. It was evicted earlier from the cache, which implies that it doesn't
have a surface now, since the cache code already takes care of
destroying it's surface once it chooses to evict it.
2. It hasn't been rendered yet.
So, in both cases, the page doesn't have a surface.
Frankly, I would prefer zathura_page_cache_is_cached to be static, and only
expose zathura_page_cache_add, because I think we don't need to concern
external code with such details (just add pages to the page cache, and it will
then take care of the rest; that's how I thought of the code when implementing
it).
--
Marwan
In commit b5237680f28d585fecf1c6d23bc7ec044e623ae1, you provide the following
check:
"if the page is not visible and not cached, but still has a surface, we need to
get rid of the surface"
Wouldn't that be redundant? I mean that if the page is not visible and not
cached, then we have two possibilities:
1. It was evicted earlier from the cache, which implies that it doesn't
have a surface now, since the cache code already takes care of
destroying it's surface once it chooses to evict it.
2. It hasn't been rendered yet.
So, in both cases, the page doesn't have a surface.
Frankly, I would prefer zathura_page_cache_is_cached to be static, and only
expose zathura_page_cache_add, because I think we don't need to concern
external code with such details (just add pages to the page cache, and it will
then take care of the rest; that's how I thought of the code when implementing
it).
--
Marwan