On pages with many render tasks (typically a lot of text shadows), we spend a lot of time moving RenderTask which is a fairly large struct into the render graph's buffer. This patch avoids it by using the VecHelper trick of allocaitng space before initializing the value. Some RenderTask::new_* methods which take the render task graph in parameter were modified to add the task and return the task ID to work around borrow-checking restriction. Differential Revision: https://phabricator.services.mozilla.com/D60854 [ghsync] From https://hg.mozilla.org/mozilla-central/rev/e30053699db0bc3c77888e789f0ba576f0904d1f