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

Unified Diff: include/gpu/GrResourceKey.h

Issue 902873002: Reimplement gpu message bus for invalidated bitmap gen IDs (Closed) Base URL: https://skia.googlesource.com/skia.git@one_tex
Patch Set: fix speeling error 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/gpu/GrGpuResource.h ('k') | include/gpu/SkGr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrResourceKey.h
diff --git a/include/gpu/GrResourceKey.h b/include/gpu/GrResourceKey.h
index e09a2c710f296de1d6d06debebcc29c787d2be35..906bc6a4beda3b0cd520bbc25755a9ce974a6430 100644
--- a/include/gpu/GrResourceKey.h
+++ b/include/gpu/GrResourceKey.h
@@ -46,11 +46,13 @@ protected:
}
GrResourceKey& operator=(const GrResourceKey& that) {
+ SkASSERT(that.isValid());
if (this != &that) {
size_t bytes = that.size();
SkASSERT(SkIsAlign4(bytes));
fKey.reset(SkToInt(bytes / sizeof(uint32_t)));
memcpy(fKey.get(), that.fKey.get(), bytes);
+ this->validate();
}
return *this;
}
@@ -236,4 +238,17 @@ public:
};
};
+// The cache listens for these messages to purge junk resources proactively.
+class GrContentKeyInvalidatedMessage {
+public:
+ explicit GrContentKeyInvalidatedMessage(const GrContentKey& key) : fKey(key) {}
+ GrContentKeyInvalidatedMessage(const GrContentKeyInvalidatedMessage& that) : fKey(that.fKey) {}
+ GrContentKeyInvalidatedMessage& operator=(const GrContentKeyInvalidatedMessage& that) {
+ fKey = that.fKey;
+ return *this;
+ }
+ const GrContentKey& key() const { return fKey; }
+private:
+ GrContentKey fKey;
+};
#endif
« no previous file with comments | « include/gpu/GrGpuResource.h ('k') | include/gpu/SkGr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698