R=reed@google.com
Review URL: https://codereview.chromium.org/
22235002
git-svn-id: http://skia.googlecode.com/svn/trunk@10556
2bbb7eff-a529-9590-31e7-
b0007b416f81
}
void SkBitmap::lockPixels() const {
- if (NULL != fPixelRef && 1 == ++fPixelLockCount) {
+ if (NULL != fPixelRef && 0 == sk_atomic_inc(&fPixelLockCount)) {
fPixelRef->lockPixels();
this->updatePixelsFromRef();
}
void SkBitmap::unlockPixels() const {
SkASSERT(NULL == fPixelRef || fPixelLockCount > 0);
- if (NULL != fPixelRef && 0 == --fPixelLockCount) {
+ if (NULL != fPixelRef && 1 == sk_atomic_dec(&fPixelLockCount)) {
fPixelRef->unlockPixels();
this->updatePixelsFromRef();
}