Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Unified Diff: src/core/SkPixelRef.cpp

Issue 960573002: fAddedToCache doesn't need to be atomic. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPixelRef.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPixelRef.cpp
diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp
index 560748c463c99dfa84cea4857085c6ff392261b8..24ee4733cb47d1b4594d8744c4d3550521a75900 100644
--- a/src/core/SkPixelRef.cpp
+++ b/src/core/SkPixelRef.cpp
@@ -100,7 +100,7 @@ SkPixelRef::SkPixelRef(const SkImageInfo& info)
this->needsNewGenID();
fIsImmutable = false;
fPreLocked = false;
- fAddedToCache.store(false);
+ fAddedToCache = false;
}
@@ -116,7 +116,7 @@ SkPixelRef::SkPixelRef(const SkImageInfo& info, SkBaseMutex* mutex)
this->needsNewGenID();
fIsImmutable = false;
fPreLocked = false;
- fAddedToCache.store(false);
+ fAddedToCache = false;
}
SkPixelRef::~SkPixelRef() {
@@ -227,10 +227,9 @@ void SkPixelRef::callGenIDChangeListeners() {
fGenIDChangeListeners[i]->onChange();
}
- // TODO: SkAtomic could add "old_value = atomic.xchg(new_value)" to make this clearer.
- if (fAddedToCache.load()) {
+ if (fAddedToCache) {
SkNotifyBitmapGenIDIsStale(this->getGenerationID());
- fAddedToCache.store(false);
+ fAddedToCache = false;
}
}
// Listeners get at most one shot, so whether these triggered or not, blow them away.
« no previous file with comments | « include/core/SkPixelRef.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698