implement tsla code review points in render monotonic time change

This commit is contained in:
Vincent Sanders 2016-04-20 19:57:44 +01:00
parent a6dd92c571
commit ea08caccb9

View File

@ -17,7 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \file
/**
* \file
* Content for text/html (implementation).
*/
@ -1376,7 +1377,7 @@ static void html_reformat(struct content *c, int width, int height)
struct box *layout;
uint64_t ms_before;
uint64_t ms_after;
uint64_t ms_next;
uint64_t ms_interval;
nsu_getmonotonic_ms(&ms_before);
@ -1406,11 +1407,11 @@ static void html_reformat(struct content *c, int width, int height)
/* calculate next reflow time at three times what it took to reflow */
nsu_getmonotonic_ms(&ms_after);
ms_next = (ms_before - ms_after) * 3;
if (ms_next < (nsoption_uint(min_reflow_period) * 10)) {
ms_next = nsoption_uint(min_reflow_period) * 10;
ms_interval = (ms_before - ms_after) * 3;
if (ms_interval < (nsoption_uint(min_reflow_period) * 10)) {
ms_interval = nsoption_uint(min_reflow_period) * 10;
}
c->reformat_time = ms_after + ms_next;
c->reformat_time = ms_after + ms_interval;
}