Bug 1064126: be more efficient with canvas memory
Merge pull request #23921 from davidflanagan/bug1064126

Bug 1064126: be more efficient with canvas memory r=russn