Chromium Code Reviews| Index: src/core/SkPixelRef.cpp |
| diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp |
| index a2c37c6e72f92de7ce16d301632dacdb6dbb1fbf..9c7507a4efc639a60b8e5a15c4621e9f5ec9bfe4 100644 |
| --- a/src/core/SkPixelRef.cpp |
| +++ b/src/core/SkPixelRef.cpp |
| @@ -5,6 +5,7 @@ |
| * found in the LICENSE file. |
| */ |
| +#include "SkBitmapCache.h" |
| #include "SkPixelRef.h" |
| #include "SkThread.h" |
| @@ -223,6 +224,7 @@ void SkPixelRef::addGenIDChangeListener(GenIDChangeListener* listener) { |
| *fGenIDChangeListeners.append() = listener; |
| } |
| +// 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 (fUniqueGenerationID) { |
| @@ -232,6 +234,12 @@ void SkPixelRef::callGenIDChangeListeners() { |
| } |
| // Listeners get at most one shot, so whether these triggered or not, blow them away. |
| fGenIDChangeListeners.deleteAll(); |
| + |
| + // if fGenerationID is 0, then perhaps we never had one, and we are in the destructor |
| + if (fGenerationID) { |
| + SkBitmapCache::NotifyGenIDStale(fGenerationID); |
|
mtklein
2015/01/07 21:52:43
Feels weird knowing both these calls really grab a
reed1
2015/01/07 22:20:41
Agree on both counts.
*if* we (later) standardize
reed1
2015/02/18 17:30:32
Captured this comment in a comment.
|
| + SkMipMapCache::NotifyGenIDStale(fGenerationID); |
| + } |
| } |
| void SkPixelRef::notifyPixelsChanged() { |