Fewer atomic ops in debug with SkBufferHead.

In debug builds an assert would do an atomic load to assert the
reference count was greater than zero, then a fetch_add would access the
value again to do the reference counting. Instead just assert in debug
on the value produced by the reference counting. This both improves
debug performance and (more importantly) makes the debug asserts correct
instead of mearly opprotunistic.

Change-Id: Ic4ce788930d2564b5f86ab0e09fcd66006c8b73d
Reviewed-on: https://skia-review.googlesource.com/55880
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
1 file changed