Bug 1595165 - Fix tile merging heuristic for picture caching. r=mstange
Bug 1595165 - Fix tile merging heuristic for picture caching. r=mstange

The implementation for identifying which nodes in the dirty tracker
tree to merge was incorrect. Each leaf node identifies if it is
static (hasn't invalidated for some time), regularly invalidating,
or somewhere in between.

The previous logic would merge the nodes if all of the children
were (static OR invalidating). The original intent of the algorithm
is to merge the nodes if (all static) OR (all invalidating).

This patch fixes the implementation, which fixes the oscillating
behavior in some cases, and describes in more detail the reasoning
for the heuristic.

Differential Revision: https://phabricator.services.mozilla.com/D55767

[wrupdater] From https://hg.mozilla.org/mozilla-central/rev/c3f7af3894df3033b11deeeee0e6ce936ddb77fb

servo/webrender,servo/webrender,servo/webrender,servo/webrender,servo/webrender,servo/webrender