SkPath: special case adding path to empty path

Chrome has code like:

SkPath path1 = ...;
SkPath path2;

path2.AddPath(path1);

This patch makes AddPath() to an empty path share the same
underlying SkPathRef. Doing this cuts down on unnecessary
allocations.

Change-Id: I806ad59b39eeafdeb5acbf265131ac3bcfb762b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/806316
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Scott Violet <sky@chromium.org>
1 file changed