Add customData capability to the thread-safe proxy cache ...
and begin using it for cached SW-generated blur masks.
This is needed to begin mixing and matching HW & SW-generated blur
masks since they have different draw-rects.
It will also be useful if/when we add support for triangulated paths
to the thread-safe cache.
Bug: 1108408
Change-Id: I085ad1127dc2deb98b35d704b06e50b27c72fd1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322657
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrThreadSafeUniquelyKeyedProxyViewCache.h b/src/gpu/GrThreadSafeUniquelyKeyedProxyViewCache.h
index 596772a..f6f9d70 100644
--- a/src/gpu/GrThreadSafeUniquelyKeyedProxyViewCache.h
+++ b/src/gpu/GrThreadSafeUniquelyKeyedProxyViewCache.h
@@ -81,11 +81,17 @@
void dropUniqueRefsOlderThan(GrStdSteadyClock::time_point purgeTime) SK_EXCLUDES(fSpinLock);
GrSurfaceProxyView find(const GrUniqueKey&) SK_EXCLUDES(fSpinLock);
+ std::tuple<GrSurfaceProxyView, sk_sp<SkData>> findWithData(
+ const GrUniqueKey&) SK_EXCLUDES(fSpinLock);
GrSurfaceProxyView add(const GrUniqueKey&, const GrSurfaceProxyView&) SK_EXCLUDES(fSpinLock);
+ std::tuple<GrSurfaceProxyView, sk_sp<SkData>> addWithData(
+ const GrUniqueKey&, const GrSurfaceProxyView&) SK_EXCLUDES(fSpinLock);
GrSurfaceProxyView findOrAdd(const GrUniqueKey&,
const GrSurfaceProxyView&) SK_EXCLUDES(fSpinLock);
+ std::tuple<GrSurfaceProxyView, sk_sp<SkData>> findOrAddWithData(
+ const GrUniqueKey&, const GrSurfaceProxyView&) SK_EXCLUDES(fSpinLock);
void remove(const GrUniqueKey&) SK_EXCLUDES(fSpinLock);
@@ -108,8 +114,10 @@
Entry* getEntry(const GrUniqueKey&, const GrSurfaceProxyView&) SK_REQUIRES(fSpinLock);
void recycleEntry(Entry*) SK_REQUIRES(fSpinLock);
- GrSurfaceProxyView internalAdd(const GrUniqueKey&,
- const GrSurfaceProxyView&) SK_REQUIRES(fSpinLock);
+ std::tuple<GrSurfaceProxyView, sk_sp<SkData>> internalFind(
+ const GrUniqueKey&) SK_REQUIRES(fSpinLock);
+ std::tuple<GrSurfaceProxyView, sk_sp<SkData>> internalAdd(
+ const GrUniqueKey&, const GrSurfaceProxyView&) SK_REQUIRES(fSpinLock);
mutable SkSpinlock fSpinLock;