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

Unified Diff: src/core/SkPixelRef.cpp

Issue 950363002: Notify resource caches when pixelref genID goes stale (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: too much, magic bus 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
Index: src/core/SkPixelRef.cpp
diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp
index c73c2f4b7dc3db2487a4d18e19b972d50b0a970f..c0f67336d1339ef8bbd6031ac1d5f99a5da7cb49 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"
@@ -214,12 +215,14 @@ 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) {
for (int i = 0; i < fGenIDChangeListeners.count(); i++) {
fGenIDChangeListeners[i]->onChange();
}
+ SkNotifyBitmapGenIDIsStale(fGenerationID);
f(malita) 2015/02/24 20:31:36 IIUC, we're going to bombard the resource cache wi
mtklein 2015/02/24 20:48:37 Sort of. It's only visible changes. It's pretty
f(malita) 2015/02/24 20:54:55 Ah, I did not notice the lazy impl - thanks for ex
reed2 2015/02/24 20:56:28 Good thought. Perhaps we can have a flag on pixelr
mtklein 2015/02/24 21:24:59 Oh actually, this is a really good point, probably
}
// Listeners get at most one shot, so whether these triggered or not, blow them away.
fGenIDChangeListeners.deleteAll();

Powered by Google App Engine
This is Rietveld 408576698