// we need to be called *before* the genID gets changed or zerod void SkPixelRef::callGenIDChangeListeners() { // We don't invalidate ourselves if we think another SkPixelRef is sharing our genID. if (this->genIDIsUnique()) { for (int i = 0; i < fGenIDChangeListeners.count(); i++) { fGenIDChangeListeners[i]->onChange(); } // TODO: SkAtomic could add "old_value = atomic.xchg(new_value)" to make this clearer. if (fAddedToCache.load()) { SkNotifyBitmapGenIDIsStale(this->getGenerationID()); fAddedToCache.store(false); } } // Listeners get at most one shot, so whether these triggered or not, blow them away. fGenIDChangeListeners.deleteAll(); }
~SkSpecialImage_Gpu() override { if (fAddedRasterVersionToCache.load()) { SkNotifyBitmapGenIDIsStale(this->uniqueID()); } }
SkImage_Gpu::~SkImage_Gpu() { if (fAddedRasterVersionToCache.load()) { SkNotifyBitmapGenIDIsStale(this->uniqueID()); } }
SkImage_Base::~SkImage_Base() { if (fAddedToCache.load()) { SkNotifyBitmapGenIDIsStale(this->uniqueID()); } }