Use a cache to minimize the number of Name objects.
Put mask data to the canvas in small slices.
Merge pull request #4355 from nnethercote/sliced-masks

Put mask data to the canvas in small slices.
Merge pull request #4354 from nnethercote/Name-cache

Use a cache to minimize the number of Name objects.