SkTArray: extract common code for the constructors

* Rename init -> initData
* Rename setItemArray -> setDataFromBytes
* Introduce setData as a way to encapsulate the data/capacity
  invariant.
* Inline initWithPreallocatedStorage, and use constructor
  forwarding to handle pre-allocated storage.

Change-Id: Id9c658be93ae88e5e9f5ae33bc1f62e3ab27f9cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/606998
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Herb Derby <herb@google.com>
1 file changed