Index: src/core/SkPixelRef.cpp |
diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp |
index 24ee4733cb47d1b4594d8744c4d3550521a75900..560748c463c99dfa84cea4857085c6ff392261b8 100644 |
--- a/src/core/SkPixelRef.cpp |
+++ b/src/core/SkPixelRef.cpp |
@@ -100,7 +100,7 @@ |
this->needsNewGenID(); |
fIsImmutable = false; |
fPreLocked = false; |
- fAddedToCache = false; |
+ fAddedToCache.store(false); |
} |
@@ -116,7 +116,7 @@ |
this->needsNewGenID(); |
fIsImmutable = false; |
fPreLocked = false; |
- fAddedToCache = false; |
+ fAddedToCache.store(false); |
} |
SkPixelRef::~SkPixelRef() { |
@@ -227,9 +227,10 @@ |
fGenIDChangeListeners[i]->onChange(); |
} |
- if (fAddedToCache) { |
+ // TODO: SkAtomic could add "old_value = atomic.xchg(new_value)" to make this clearer. |
+ if (fAddedToCache.load()) { |
SkNotifyBitmapGenIDIsStale(this->getGenerationID()); |
- fAddedToCache = false; |
+ fAddedToCache.store(false); |
} |
} |
// Listeners get at most one shot, so whether these triggered or not, blow them away. |