Reland https://codereview.chromium.org/860333002 with fix for test failures.

Revert "Revert of Make GrScratchKey memory buffer correct size on copy (patchset #1 id:1 of https://codereview.chromium.org/860333002/)"

This reverts commit 988018c817f341c0ce09297b7ba5ba60ba76eba9.

BUG=skia:

Review URL: https://codereview.chromium.org/863983003
2 files changed