ccpr: Use SkMessageBus for thread-safe eviction of cache entries
Bug: skia:
Change-Id: I87725b95761deb689333315ce681a4968d98190a
Reviewed-on: https://skia-review.googlesource.com/c/163511
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h
index 1d3598e..16accbb 100644
--- a/src/gpu/GrResourceCache.h
+++ b/src/gpu/GrResourceCache.h
@@ -27,12 +27,14 @@
struct GrGpuResourceFreedMessage {
GrGpuResource* fResource;
uint32_t fOwningUniqueID;
- bool shouldSend(uint32_t inboxID) const {
- // The inbox's ID is the unique ID of the owning GrContext.
- return inboxID == fOwningUniqueID;
- }
};
+static inline bool SkShouldPostMessageToBus(
+ const GrGpuResourceFreedMessage& msg, uint32_t msgBusUniqueID) {
+ // The inbox's ID is the unique ID of the owning GrContext.
+ return msgBusUniqueID == msg.fOwningUniqueID;
+}
+
/**
* Manages the lifetime of all GrGpuResource instances.
*