Add less granular version of GrFence for older Metal versions.

Rather than use MTLSharedEvent, we create a semaphore and
signal it within the current command buffer's completion handler.
The pointer to the semaphore is cast as GrFence and returned.
The waitFence method recasts it and waits on the semaphore.

Bug: skia:8243
Change-Id: I2c854c65a62786fe8031794008eb6844974ebefd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245583
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2 files changed