Add method to calculate size of a DataPayloadField.

Using a switch lets the compiler flag an error if we add a
DataPayloadType and forget to update this function.

Despite initial appearances it's quite efficient when compiled:
https://godbolt.org/z/vqoaddGn4

Change-Id: I5f650afdf81205942966fb318643ff4af5a29252
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550501
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
1 file changed